Build from scratch rather than debian

This commit is contained in:
Paul Cager
2021-03-16 19:10:07 +00:00
parent 9122ef210f
commit 1d2c324747
+3 -7
View File
@@ -1,14 +1,10 @@
FROM paulcager/go-base:latest as build
WORKDIR /go
COPY go.mod *.go ./src/osgrid-server/
RUN cd /go/src/osgrid-server && \
go install -v ./... && \
COPY * ./
RUN CGO_ENABLED=0 go install -v ./... && \
sha256sum /go/bin/osgrid-server
FROM debian:stable-slim
RUN apt-get update && apt-get -y upgrade
FROM scratch
WORKDIR /app
COPY --from=build /go/bin/osgrid-server .
EXPOSE 9090