From 7c6b94473e9531822ebf4d72a1c839b96bebc43f Mon Sep 17 00:00:00 2001 From: Long Dai Date: Mon, 17 May 2021 10:43:05 +0800 Subject: [PATCH 1/4] exmaples: unify apt and cleanup useless installation Signed-off-by: Long Dai --- examples/cache/Dockerfile-frontenvoy | 2 -- examples/cors/backend/Dockerfile-frontenvoy | 2 -- examples/cors/frontend/Dockerfile-frontenvoy | 2 -- examples/csrf/crosssite/Dockerfile-frontenvoy | 2 -- examples/csrf/samesite/Dockerfile-frontenvoy | 2 -- examples/dynamic-config-cp/Dockerfile-control-plane | 1 - examples/dynamic-config-cp/Dockerfile-proxy | 1 - examples/ext_authz/Dockerfile-frontenvoy | 2 -- examples/fault-injection/Dockerfile-envoy | 6 +++++- examples/front-proxy/Dockerfile-frontenvoy | 7 +++++-- examples/jaeger-native-tracing/Dockerfile-frontenvoy | 2 -- examples/skywalking-tracing/Dockerfile-frontenvoy | 2 -- examples/zipkin-tracing/Dockerfile-frontenvoy | 2 -- 13 files changed, 10 insertions(+), 23 deletions(-) diff --git a/examples/cache/Dockerfile-frontenvoy b/examples/cache/Dockerfile-frontenvoy index 0b2e25a0de1bd..80d3fd894e59a 100644 --- a/examples/cache/Dockerfile-frontenvoy +++ b/examples/cache/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./front-envoy.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy diff --git a/examples/cors/backend/Dockerfile-frontenvoy b/examples/cors/backend/Dockerfile-frontenvoy index 31ee1c2e74321..67ab98915d019 100644 --- a/examples/cors/backend/Dockerfile-frontenvoy +++ b/examples/cors/backend/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./front-envoy.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD ["/usr/local/bin/envoy", "-c", "/etc/front-envoy.yaml", "--service-cluster", "front-proxy"] diff --git a/examples/cors/frontend/Dockerfile-frontenvoy b/examples/cors/frontend/Dockerfile-frontenvoy index 31ee1c2e74321..67ab98915d019 100644 --- a/examples/cors/frontend/Dockerfile-frontenvoy +++ b/examples/cors/frontend/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./front-envoy.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD ["/usr/local/bin/envoy", "-c", "/etc/front-envoy.yaml", "--service-cluster", "front-proxy"] diff --git a/examples/csrf/crosssite/Dockerfile-frontenvoy b/examples/csrf/crosssite/Dockerfile-frontenvoy index 31ee1c2e74321..67ab98915d019 100644 --- a/examples/csrf/crosssite/Dockerfile-frontenvoy +++ b/examples/csrf/crosssite/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./front-envoy.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD ["/usr/local/bin/envoy", "-c", "/etc/front-envoy.yaml", "--service-cluster", "front-proxy"] diff --git a/examples/csrf/samesite/Dockerfile-frontenvoy b/examples/csrf/samesite/Dockerfile-frontenvoy index 799a5721130a1..597da0315b785 100644 --- a/examples/csrf/samesite/Dockerfile-frontenvoy +++ b/examples/csrf/samesite/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./front-envoy.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD ["/usr/local/bin/envoy", "-c", "/etc/front-envoy.yaml", "--service-cluster", "front-proxy"] diff --git a/examples/dynamic-config-cp/Dockerfile-control-plane b/examples/dynamic-config-cp/Dockerfile-control-plane index 3c5bd17826ef5..ce27665239de5 100644 --- a/examples/dynamic-config-cp/Dockerfile-control-plane +++ b/examples/dynamic-config-cp/Dockerfile-control-plane @@ -1,6 +1,5 @@ FROM golang -RUN apt-get -y update && apt-get install -y -qq --no-install-recommends netcat RUN git clone https://github.com/envoyproxy/go-control-plane ADD ./resource.go /go/go-control-plane/internal/example/resource.go RUN cd go-control-plane && make bin/example diff --git a/examples/dynamic-config-cp/Dockerfile-proxy b/examples/dynamic-config-cp/Dockerfile-proxy index 6e1c4d08b6cb1..f70f443114613 100644 --- a/examples/dynamic-config-cp/Dockerfile-proxy +++ b/examples/dynamic-config-cp/Dockerfile-proxy @@ -1,6 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get -y update && apt-get install -y -qq --no-install-recommends netcat COPY ./envoy.yaml /etc/envoy.yaml RUN chmod go+r /etc/envoy.yaml CMD ["/usr/local/bin/envoy", "-c /etc/envoy.yaml", "-l", "debug"] diff --git a/examples/ext_authz/Dockerfile-frontenvoy b/examples/ext_authz/Dockerfile-frontenvoy index 815937798a830..dc225158365be 100644 --- a/examples/ext_authz/Dockerfile-frontenvoy +++ b/examples/ext_authz/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./config /etc/envoy-config COPY ./run_envoy.sh /run_envoy.sh RUN chmod go+r -R /etc/envoy-config \ diff --git a/examples/fault-injection/Dockerfile-envoy b/examples/fault-injection/Dockerfile-envoy index 13dec2521a999..30be6156f128b 100644 --- a/examples/fault-injection/Dockerfile-envoy +++ b/examples/fault-injection/Dockerfile-envoy @@ -1,6 +1,10 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get install -y curl tree +RUN apt-get update \ + && apt-get install --no-install-recommends -y tree \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* COPY ./envoy.yaml /etc/envoy.yaml RUN chmod go+r /etc/envoy.yaml COPY enable_delay_fault_injection.sh disable_delay_fault_injection.sh enable_abort_fault_injection.sh disable_abort_fault_injection.sh send_request.sh / diff --git a/examples/front-proxy/Dockerfile-frontenvoy b/examples/front-proxy/Dockerfile-frontenvoy index 31ee1c2e74321..e47f93f095bf2 100644 --- a/examples/front-proxy/Dockerfile-frontenvoy +++ b/examples/front-proxy/Dockerfile-frontenvoy @@ -1,7 +1,10 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl +RUN apt-get update \ + && apt-get install --no-install-recommends -y curl \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* COPY ./front-envoy.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD ["/usr/local/bin/envoy", "-c", "/etc/front-envoy.yaml", "--service-cluster", "front-proxy"] diff --git a/examples/jaeger-native-tracing/Dockerfile-frontenvoy b/examples/jaeger-native-tracing/Dockerfile-frontenvoy index d92faf3834eb7..2b54a975a07a2 100644 --- a/examples/jaeger-native-tracing/Dockerfile-frontenvoy +++ b/examples/jaeger-native-tracing/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./front-envoy-jaeger.yaml /etc/front-envoy.yaml # # for discussion on jaeger binary compatibility, and the source of the file, see here: diff --git a/examples/skywalking-tracing/Dockerfile-frontenvoy b/examples/skywalking-tracing/Dockerfile-frontenvoy index 86d0a6b91b8bf..a4be8e8060341 100644 --- a/examples/skywalking-tracing/Dockerfile-frontenvoy +++ b/examples/skywalking-tracing/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./front-envoy-skywalking.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy diff --git a/examples/zipkin-tracing/Dockerfile-frontenvoy b/examples/zipkin-tracing/Dockerfile-frontenvoy index cd80edc3ba04d..700a6b78eac49 100644 --- a/examples/zipkin-tracing/Dockerfile-frontenvoy +++ b/examples/zipkin-tracing/Dockerfile-frontenvoy @@ -1,7 +1,5 @@ FROM envoyproxy/envoy-dev:latest -RUN apt-get update && apt-get -q install -y \ - curl COPY ./front-envoy-zipkin.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD ["/usr/local/bin/envoy", "-c", "/etc/front-envoy.yaml", "--service-cluster", "front-proxy"] From 7fc57bc79969d9529e14bfc34b7568a8f633e31e Mon Sep 17 00:00:00 2001 From: Long Dai Date: Tue, 18 May 2021 13:47:29 +0800 Subject: [PATCH 2/4] feedback Signed-off-by: Long Dai --- examples/dynamic-config-cp/Dockerfile-control-plane | 6 ++++++ examples/fault-injection/Dockerfile-envoy | 2 +- examples/jaeger-native-tracing/Dockerfile-frontenvoy | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/dynamic-config-cp/Dockerfile-control-plane b/examples/dynamic-config-cp/Dockerfile-control-plane index ce27665239de5..7f4be92b30c59 100644 --- a/examples/dynamic-config-cp/Dockerfile-control-plane +++ b/examples/dynamic-config-cp/Dockerfile-control-plane @@ -1,5 +1,11 @@ FROM golang +RUN apt-get update \ + && apt-get install --no-install-recommends -y curl \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* + RUN git clone https://github.com/envoyproxy/go-control-plane ADD ./resource.go /go/go-control-plane/internal/example/resource.go RUN cd go-control-plane && make bin/example diff --git a/examples/fault-injection/Dockerfile-envoy b/examples/fault-injection/Dockerfile-envoy index 30be6156f128b..17e350d7d535a 100644 --- a/examples/fault-injection/Dockerfile-envoy +++ b/examples/fault-injection/Dockerfile-envoy @@ -1,7 +1,7 @@ FROM envoyproxy/envoy-dev:latest RUN apt-get update \ - && apt-get install --no-install-recommends -y tree \ + && apt-get install --no-install-recommends -y tree curl \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* diff --git a/examples/jaeger-native-tracing/Dockerfile-frontenvoy b/examples/jaeger-native-tracing/Dockerfile-frontenvoy index 2b54a975a07a2..831c38489dea6 100644 --- a/examples/jaeger-native-tracing/Dockerfile-frontenvoy +++ b/examples/jaeger-native-tracing/Dockerfile-frontenvoy @@ -1,5 +1,11 @@ FROM envoyproxy/envoy-dev:latest +RUN apt-get update \ + && apt-get install --no-install-recommends -y curl \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* + COPY ./front-envoy-jaeger.yaml /etc/front-envoy.yaml # # for discussion on jaeger binary compatibility, and the source of the file, see here: From 84e1ea3dd2c305957385ad0f963b30b6351ab30b Mon Sep 17 00:00:00 2001 From: Long Dai Date: Tue, 18 May 2021 13:54:08 +0800 Subject: [PATCH 3/4] fix typos Signed-off-by: Long Dai --- examples/dynamic-config-cp/Dockerfile-control-plane | 2 +- examples/front-proxy/Dockerfile-frontenvoy | 2 +- examples/jaeger-native-tracing/Dockerfile-frontenvoy | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/dynamic-config-cp/Dockerfile-control-plane b/examples/dynamic-config-cp/Dockerfile-control-plane index 7f4be92b30c59..ada27cbb1f245 100644 --- a/examples/dynamic-config-cp/Dockerfile-control-plane +++ b/examples/dynamic-config-cp/Dockerfile-control-plane @@ -4,7 +4,7 @@ RUN apt-get update \ && apt-get install --no-install-recommends -y curl \ && apt-get autoremove -y \ && apt-get clean \ - && rm -rf /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* + && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* RUN git clone https://github.com/envoyproxy/go-control-plane ADD ./resource.go /go/go-control-plane/internal/example/resource.go diff --git a/examples/front-proxy/Dockerfile-frontenvoy b/examples/front-proxy/Dockerfile-frontenvoy index e47f93f095bf2..183d46c7a5c38 100644 --- a/examples/front-proxy/Dockerfile-frontenvoy +++ b/examples/front-proxy/Dockerfile-frontenvoy @@ -4,7 +4,7 @@ RUN apt-get update \ && apt-get install --no-install-recommends -y curl \ && apt-get autoremove -y \ && apt-get clean \ - && rm -rf /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* + && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* COPY ./front-envoy.yaml /etc/front-envoy.yaml RUN chmod go+r /etc/front-envoy.yaml CMD ["/usr/local/bin/envoy", "-c", "/etc/front-envoy.yaml", "--service-cluster", "front-proxy"] diff --git a/examples/jaeger-native-tracing/Dockerfile-frontenvoy b/examples/jaeger-native-tracing/Dockerfile-frontenvoy index 831c38489dea6..ef40a9365ed25 100644 --- a/examples/jaeger-native-tracing/Dockerfile-frontenvoy +++ b/examples/jaeger-native-tracing/Dockerfile-frontenvoy @@ -4,7 +4,7 @@ RUN apt-get update \ && apt-get install --no-install-recommends -y curl \ && apt-get autoremove -y \ && apt-get clean \ - && rm -rf /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* + && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* COPY ./front-envoy-jaeger.yaml /etc/front-envoy.yaml # From 4c6e7ef7250d9a83f06e8e005e2bc7242367af0d Mon Sep 17 00:00:00 2001 From: Long Dai Date: Tue, 18 May 2021 14:19:51 +0800 Subject: [PATCH 4/4] fix typo Signed-off-by: Long Dai --- examples/dynamic-config-cp/Dockerfile-control-plane | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dynamic-config-cp/Dockerfile-control-plane b/examples/dynamic-config-cp/Dockerfile-control-plane index ada27cbb1f245..39c7f2ca4223b 100644 --- a/examples/dynamic-config-cp/Dockerfile-control-plane +++ b/examples/dynamic-config-cp/Dockerfile-control-plane @@ -1,7 +1,7 @@ FROM golang RUN apt-get update \ - && apt-get install --no-install-recommends -y curl \ + && apt-get install --no-install-recommends -y netcat \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*