envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.51k stars 4.73k forks source link

The docker image of main branch can not validate hello-world yaml file #25507

Closed YvesZHI closed 1 year ago

YvesZHI commented 1 year ago

I want to try to do some tiny enhancement for Envoy so I tried to build an Docker image of Envoy from source code.

Here is what I've done on my Ubuntu server:

git clone https://github.com/envoyproxy/envoy.git    # main branch
sudo -E ./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.release.server_only'
sudo docker build --network=host -f ./ci/Dockerfile-envoy -t envoy .

Now I can see an Envoy docker image has been built. Here is the output of sudo docker images:

REPOSITORY                      TAG                                        IMAGE ID       CREATED          SIZE
envoy                           latest                                     44868d9d4827   33 minutes ago   146MB
envoyproxy/envoy                v1.22-latest                               f206ef179ba7   4 days ago       132MB
envoyproxy/envoy-build-ubuntu   7304f974de2724617b7492ccb4c9c58cd420353a   d4d024cc51b6   3 weeks ago      6.68GB

So the first line is just what I built, the second line is the official Envoy image, which has been downloaded before.

Then I made a docker-compose yaml file:

version: "3.5"

x-volumes-common: &volumes_common
  - "./envoy.yaml:/etc/envoy/envoy.yaml:ro"

x-meta-info: &meta_info
  image: envoy:latest   # my envoy: ERROR!
#  image: envoyproxy/envoy:v1.22-latest    # official envoy: OK
  container_name: envoy_gw
  restart: "always"
  volumes: *volumes_common
  network_mode: "host"

services:
  envoyv: # validate envoy config file
    <<: *meta_info
    profiles: ["validation"]
    command: envoy --mode validate --config-path /etc/envoy/envoy.yaml
  envoy:
    <<: *meta_info

Besides, I downloaded a hello-world yaml config file from here: https://www.envoyproxy.io/docs/envoy/v1.25.1/start/quick-start/run-envoy.

However, when I execute sudo docker compose run --rm --service-ports envoyv to validate the hello-world yaml config file, I always get the error:

[2023-02-13 11:15:49.216][1][critical][main] [source/server/config_validation/server.cc:66] error initializing configuration '/etc/envoy/envoy.yaml': Didn't find a registered implementation for name: 'envoy.listener_manager_impl.validation'

But if use the official Docker image (image: envoyproxy/envoy:v1.22-latest in the docker-compose yaml file), everything would be fine.

So it seem that I built an Docker image with some bugs...

Did I do something wrong? Or is there some bug on the main branch of the github repository of Envoy?

phlax commented 1 year ago

github repository of Envoy has always been tested?

the images that are built in CI and published to dockerhub are tested - at least the ubuntu one is - pretty extensively

without trying to track the exact issue, it looks to me like you are mixing versions of config and and docker images

if you are using example configs, or downloading them, try to make sure that they match the version of envoy that you are testing

phlax commented 1 year ago

if that is not the case - im happy to try and figure out what is going wrong

YvesZHI commented 1 year ago

@phlax Thanks dude, you are totally right. git clone is not enough, I need to checkout to a verified tag.