添加 'Dockerfile'
This commit is contained in:
		
							
								
								
									
										18
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					FROM golang:alpine AS build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /go/src/github.com/yumc.pw/cloud
 | 
				
			||||||
 | 
					RUN apk add --no-cache git
 | 
				
			||||||
 | 
					RUN go get github.com/gin-gonic/gin
 | 
				
			||||||
 | 
					ADD main.go .
 | 
				
			||||||
 | 
					RUN go build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FROM alpine:edge
 | 
				
			||||||
 | 
					MAINTAINER MiaoWoo<admin@yumc.pw>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENV LANG C.UTF-8
 | 
				
			||||||
 | 
					WORKDIR /root
 | 
				
			||||||
 | 
					RUN apk add --no-cache ca-certificates
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY --from=build /go/src/github.com/yumc.pw/cloud/cloud ./main
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CMD ["./main"]
 | 
				
			||||||
		Reference in New Issue
	
	Block a user