mirror of https://github.com/linkerd/linkerd2.git
				
				
				
			
		
			
				
	
	
		
			22 lines
		
	
	
		
			963 B
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			963 B
		
	
	
	
		
			Plaintext
		
	
	
	
## compile binaries
 | 
						|
FROM gcr.io/runconduit/go-deps:b93abc8a as golang
 | 
						|
ARG CONDUIT_VERSION
 | 
						|
WORKDIR /go/src/github.com/runconduit/conduit
 | 
						|
COPY cli cli
 | 
						|
COPY controller/api controller/api
 | 
						|
COPY controller/gen controller/gen
 | 
						|
COPY controller/util controller/util
 | 
						|
COPY pkg pkg
 | 
						|
RUN mkdir -p /out
 | 
						|
ENV GO_LDFLAGS="-s -w -X github.com/runconduit/conduit/pkg/version.Version=${CONDUIT_VERSION}"
 | 
						|
RUN CGO_ENABLED=0 GOOS=darwin  go build -installsuffix cgo -o /out/conduit-darwin  -ldflags "${GO_LDFLAGS}" ./cli
 | 
						|
RUN CGO_ENABLED=0 GOOS=linux   go build -installsuffix cgo -o /out/conduit-linux   -ldflags "${GO_LDFLAGS}" ./cli
 | 
						|
RUN CGO_ENABLED=0 GOOS=windows go build -installsuffix cgo -o /out/conduit-windows -ldflags "${GO_LDFLAGS}" ./cli
 | 
						|
 | 
						|
## export without sources & dependencies
 | 
						|
FROM scratch
 | 
						|
COPY --from=golang /out /out
 | 
						|
# `ENTRYPOINT` prevents `docker build` from otherwise failing with "Error
 | 
						|
# response from daemon: No command specified."
 | 
						|
ENTRYPOINT ["/out/conduit-linux"]
 |