forked from linkerd/linkerd2-proxy-init
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (23 loc) · 829 Bytes
/
Dockerfile
File metadata and controls
26 lines (23 loc) · 829 Bytes
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
## compile proxy-init utility
FROM --platform=$BUILDPLATFORM golang:1.12.9 as golang
WORKDIR /build
# cache dependencies
COPY go.mod .
COPY go.sum .
RUN go mod download
# build
COPY . .
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH go build -o /out/linkerd2-proxy-init -mod=readonly -ldflags "-s -w" -v
## package runtime
FROM --platform=$TARGETPLATFORM debian:buster-20201117-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
iptables \
procps \
&& rm -rf /var/lib/apt/lists/* \
&& update-alternatives --set iptables /usr/sbin/iptables-legacy \
&& update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
COPY LICENSE /linkerd/LICENSE
COPY --from=golang /out/linkerd2-proxy-init /usr/local/bin/proxy-init
ENTRYPOINT ["/usr/local/bin/proxy-init"]