19 lines
		
	
	
		
			520 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			520 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
| FROM golang:1.21 as build
 | |
| 
 | |
| WORKDIR /app
 | |
| 
 | |
| COPY . .
 | |
| 
 | |
| RUN go mod tidy && CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o mail-dns-service ./cmd/
 | |
| 
 | |
| FROM scratch
 | |
| 
 | |
| COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
 | |
| COPY --from=build /etc/passwd /etc/passwd
 | |
| COPY --from=build /etc/group /etc/group
 | |
| COPY --from=build --chown=65534:65534 /app/mail-dns-service /usr/local/bin/mail-dns-service
 | |
| 
 | |
| USER nobody
 | |
| 
 | |
| ENTRYPOINT ["/usr/local/bin/mail-dns-service"]
 |