mirror of https://github.com/linkerd/linkerd2.git
				
				
				
			
		
			
				
	
	
		
			21 lines
		
	
	
		
			859 B
		
	
	
	
		
			Docker
		
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			859 B
		
	
	
	
		
			Docker
		
	
	
	
## compile controller services
 | 
						|
FROM gcr.io/linkerd-io/go-deps:34096b37 as golang
 | 
						|
WORKDIR /go/src/github.com/linkerd/linkerd2
 | 
						|
COPY controller/gen controller/gen
 | 
						|
COPY pkg pkg
 | 
						|
COPY controller controller
 | 
						|
 | 
						|
# Cache a build without version info
 | 
						|
RUN CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo ./pkg/...
 | 
						|
RUN CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo ./controller/cmd/...
 | 
						|
 | 
						|
ARG CONDUIT_VERSION
 | 
						|
# use `install` so that we produce multiple binaries
 | 
						|
RUN CGO_ENABLED=0 GOOS=linux go install -installsuffix cgo -ldflags "-X github.com/linkerd/linkerd2/pkg/version.Version=${CONDUIT_VERSION}" ./pkg/...
 | 
						|
RUN CGO_ENABLED=0 GOOS=linux go install -installsuffix cgo -ldflags "-X github.com/linkerd/linkerd2/pkg/version.Version=${CONDUIT_VERSION}" ./controller/cmd/...
 | 
						|
 | 
						|
## package runtime
 | 
						|
FROM scratch
 | 
						|
ENV PATH=$PATH:/go/bin
 | 
						|
COPY --from=golang /go/bin /go/bin
 |