This commit is contained in:
C菌
2021-04-15 22:08:12 +08:00
commit f506f64266
10 changed files with 264 additions and 0 deletions

12
Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM golang:1.15.9-alpine AS builder
LABEL anther="cjun"
WORKDIR /app
COPY ./main.go /app
ENV GO111MODULE=off
RUN GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -o hello main.go
FROM alpine:latest AS runner
COPY --from=builder /app/hello /app/hello
WORKDIR /app
EXPOSE 80
CMD ["./hello"]