 dc2d6b5119
			
		
	
	
		dc2d6b5119
		
			
		
	
	
	
		
			
	
		
	
	
		
			Some checks failed
		
		
	
	Extra / Vulnerability scanner (push) Failing after 41s
				CI / go-mod (push) Failing after 17m9s
				CI / golangci-lint (push) Failing after 15m36s
				Release a tag / release (push) Failing after 15m34s
				CI / tests-on-windows (push) Has been cancelled
				CI / tests-on-macos (push) Has been cancelled
				CI / tests-on-unix (1.13) (push) Has been cancelled
				CI / tests-on-unix (1.14) (push) Has been cancelled
				CI / tests-on-unix (1.15) (push) Has been cancelled
				CI / check_generated (push) Has been cancelled
				Release a tag / docker-release (map[Dockerfile:build/Dockerfile.alpine]) (push) Has been cancelled
				Release a tag / docker-release (map[Dockerfile:build/Dockerfile]) (push) Has been cancelled
				* build(docker): Fix version details in docker image As part of #1383, multi-arch docker build was supported. However, ldflags for version details was missing. This commit is to add -ldflags as part of Docker build. I take this chance to refactor github action as well. Fixes #1468 Signed-off-by: Tam Mach <sayboras@yahoo.com>
		
			
				
	
	
		
			17 lines
		
	
	
		
			470 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			470 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
| # stage 1 building the code
 | |
| FROM golang:1.15 as builder
 | |
| 
 | |
| ARG VERSION
 | |
| ARG SHORT_COMMIT
 | |
| ARG DATE
 | |
| 
 | |
| COPY / /golangci
 | |
| WORKDIR /golangci
 | |
| RUN CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=$VERSION -X main.commit=$SHORT_COMMIT -X main.date=$DATE" -o golangci-lint ./cmd/golangci-lint/main.go
 | |
| 
 | |
| # stage 2
 | |
| FROM golang:1.15
 | |
| # don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
 | |
| COPY --from=builder /golangci/golangci-lint /usr/bin/
 | |
| CMD ["golangci-lint"]
 |