/
Dockerfile.proxytproxy
53 lines (39 loc) · 2.17 KB
/
Dockerfile.proxytproxy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Version is the base image version from the TLD Makefile
ARG BASE_VERSION=latest
# The following section is used as base image if BASE_DISTRIBUTION=default
FROM docker.io/istio/base:${BASE_VERSION} as default
ARG proxy_version
ARG istio_version
# Environment variable indicating the exact proxy sha - for debugging or version-specific configs
ENV ISTIO_META_ISTIO_PROXY_SHA $proxy_version
# Environment variable indicating the exact build, for debugging
ENV ISTIO_META_ISTIO_VERSION $istio_version
# This sidecar will use TPROXY for interception
ENV ISTIO_META_INTERCEPTION_MODE TPROXY
# Please keep in sync with Dockerfile.v2
# This proxy will use TPROXY interception. Core dump won't work - see issue 5745
# User will need to use the proxy annotation to use this image, as well as the
# original InterceptionMode annotation to run as root and add NET_ADMIN
# This doesn't (yet) extend proxyv2 - need to change the makefile to customize the FROM to match the hub/tag that
# is currently built, or use a base image.
# TODO: evaluate if we should add NET_ADMIN in all cases, to support future firewall
# and dynamic iptable config
COPY envoy /usr/local/bin/envoy
COPY pilot-agent /usr/local/bin/pilot-agent
COPY envoy_pilot.yaml.tmpl /etc/istio/proxy/envoy_pilot.yaml.tmpl
COPY envoy_policy.yaml.tmpl /etc/istio/proxy/envoy_policy.yaml.tmpl
COPY envoy_telemetry.yaml.tmpl /etc/istio/proxy/envoy_telemetry.yaml.tmpl
COPY istio-iptables /usr/local/bin/istio-iptables
# Copy Envoy bootstrap templates used by pilot-agent
COPY envoy_bootstrap_v2.json /var/lib/istio/envoy/envoy_bootstrap_tmpl.json
COPY gcp_envoy_bootstrap.json /var/lib/istio/envoy/gcp_envoy_bootstrap_tmpl.json
RUN chown -R istio-proxy /var/lib/istio
# pilot-agent and envoy may run with effective uid 0 in order to run envoy with
# CAP_NET_ADMIN, so any iptables rule matching on "-m owner --uid-owner
# istio-proxy" will not match connections from those processes anymore.
# Instead, rely on the process's effective gid being istio-proxy and create a
# "-m owner --gid-owner istio-proxy" iptables rule in istio-iptables.sh.
# hadolint ignore=DL3002
USER 0:1337
# The pilot-agent will bootstrap Envoy.
ENTRYPOINT ["/usr/local/bin/pilot-agent"]