2023-01-17 22:16:55 +00:00
|
|
|
# Note these args have to be before the first FROM
|
|
|
|
ARG CONSUL_IMAGE
|
2022-11-01 19:03:23 +00:00
|
|
|
ARG ENVOY_VERSION
|
|
|
|
|
2023-01-17 22:16:55 +00:00
|
|
|
FROM ${CONSUL_IMAGE} as consul
|
2022-11-01 19:03:23 +00:00
|
|
|
|
|
|
|
FROM docker.mirror.hashicorp.services/envoyproxy/envoy:v${ENVOY_VERSION}
|
2023-04-26 16:49:38 +00:00
|
|
|
|
|
|
|
# Install iptables and sudo, needed for tproxy.
|
|
|
|
RUN apt update -y \
|
|
|
|
&& apt install -y iptables sudo curl dnsutils \
|
|
|
|
&& adduser envoy sudo \
|
|
|
|
&& echo 'envoy ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
|
|
|
|
|
|
|
COPY tproxy-startup.sh /bin/tproxy-startup.sh
|
|
|
|
RUN chmod +x /bin/tproxy-startup.sh \
|
|
|
|
&& chown envoy:envoy /bin/tproxy-startup.sh
|
|
|
|
|
2022-11-01 19:03:23 +00:00
|
|
|
COPY --from=consul /bin/consul /bin/consul
|
2023-04-26 16:49:38 +00:00
|
|
|
|
|
|
|
USER envoy
|