This commit is contained in:
		
							
								
								
									
										10
									
								
								.drone.yml
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								.drone.yml
									
									
									
									
									
								
							| @@ -20,6 +20,16 @@ steps: | ||||
|     commands: | ||||
|       - echo bonjour monde | ||||
|  | ||||
|   - name: docker | ||||
|     image: plugins/docker | ||||
|     repo: esinio/helloworld | ||||
|     auto_tag: true | ||||
|     auto_tag_suffix: linux-amd64 | ||||
|     username: | ||||
|       from_secret: docker_username | ||||
|     password: | ||||
|       from_secret: docker_password | ||||
|  | ||||
| trigger: | ||||
|   branch: | ||||
|     - master | ||||
|   | ||||
							
								
								
									
										18
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| FROM golang:alpine as builder | ||||
|  | ||||
| ENV CGO_ENABLED=0 | ||||
| ENV GOOS="linux" | ||||
| ENV GOARCH="amd64" | ||||
|  | ||||
| RUN apk --no-cache add ca-certificates | ||||
| RUN go build -ldflags="-s -w" -tags timetzdata -o app main.go | ||||
|  | ||||
| FROM scratch as production | ||||
|  | ||||
| ENV TZ="Asia/Shanghai" | ||||
|  | ||||
| COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||||
| COPY --from=builder /app . | ||||
|  | ||||
|  | ||||
| CMD ["./app"] | ||||
		Reference in New Issue
	
	Block a user