mirror of https://github.com/linkerd/linkerd2.git
				
				
				
			
		
			
				
	
	
		
			31 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
ARG RUNTIME_IMAGE=debian:stretch-20190812-slim
 | 
						|
 | 
						|
FROM debian:stretch-20190812-slim as fetch
 | 
						|
RUN apt-get update && apt-get install -y ca-certificates curl
 | 
						|
WORKDIR /build
 | 
						|
COPY bin/fetch-proxy bin/fetch-proxy
 | 
						|
COPY .proxy-version proxy-version
 | 
						|
RUN (proxy=$(bin/fetch-proxy $(cat proxy-version)) && \
 | 
						|
    mv "$proxy" linkerd2-proxy)
 | 
						|
 | 
						|
## compile proxy-identity agent
 | 
						|
FROM gcr.io/linkerd-io/go-deps:93ea34a8 as golang
 | 
						|
WORKDIR /linkerd-build
 | 
						|
COPY pkg/flags pkg/flags
 | 
						|
COPY pkg/tls pkg/tls
 | 
						|
COPY pkg/version pkg/version
 | 
						|
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly ./pkg/...
 | 
						|
COPY proxy-identity proxy-identity
 | 
						|
RUN CGO_ENABLED=0 GOOS=linux go build -o /out/proxy-identity -mod=readonly -ldflags "-s -w" ./proxy-identity
 | 
						|
 | 
						|
FROM $RUNTIME_IMAGE as runtime
 | 
						|
COPY --from=fetch /build/target/proxy/LICENSE /usr/lib/linkerd/LICENSE
 | 
						|
COPY --from=fetch /build/proxy-version /usr/lib/linkerd/linkerd2-proxy-version.txt
 | 
						|
COPY --from=fetch /build/linkerd2-proxy /usr/lib/linkerd/linkerd2-proxy
 | 
						|
COPY --from=golang /out/proxy-identity /usr/lib/linkerd/linkerd2-proxy-identity
 | 
						|
COPY proxy-identity/run-proxy.sh /usr/bin/linkerd2-proxy-run
 | 
						|
ARG LINKERD_VERSION
 | 
						|
ENV LINKERD_CONTAINER_VERSION_OVERRIDE=${LINKERD_VERSION}
 | 
						|
ENV LINKERD2_PROXY_LOG=warn,linkerd=info
 | 
						|
ENTRYPOINT ["/usr/bin/linkerd2-proxy-run"]
 |