diff --git a/Dockerfile b/Dockerfile index 244d3d1..48eceb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,18 @@ -FROM golang:1.16 AS builder +FROM golang:1.16-alpine AS builder WORKDIR /go/src/app COPY . . -RUN CGO_ENABLED=0 GOOS=linux go get -d -v . && \ +RUN CGO_ENABLED=0 GOOS=linux \ + go get -d -v . && \ go build -a -tags netgo -o b56 -FROM alpine:3.14 +FROM scratch -WORKDIR /app +WORKDIR / COPY --from=builder /go/src/app/b56 . COPY ./static ./static EXPOSE 80 -CMD ["/app/b56"] +CMD ["/b56"]