-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from mgr9525/dev
add Dockerfile
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## 感谢 lockp111 提供的Dockerfile | ||
|
||
FROM golang:1.15.2-alpine AS builder | ||
|
||
RUN apk add git gcc libc-dev && git clone https://github.com/mgr9525/gokins.git /build | ||
WORKDIR /build | ||
RUN GOOS=linux GOARCH=amd64 go build -o bin/gokins main.go | ||
|
||
|
||
FROM alpine:latest AS final | ||
|
||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk --no-cache add openssl \ | ||
&& apk --no-cache add ca-certificates \ | ||
&& rm -rf /var/cache/apk \ | ||
&& mkdir -p /app | ||
|
||
COPY --from=builder /build/bin/gokins /app | ||
WORKDIR /app | ||
ENTRYPOINT ["/app/gokins"] | ||
|