Add simplistic Dockerfile

This commit is contained in:
eikendev 2020-07-27 22:05:00 +02:00
parent 0b7010c693
commit 470a3f819d
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
2 changed files with 21 additions and 0 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
.git
Dockerfile

19
Dockerfile Normal file
View file

@ -0,0 +1,19 @@
FROM golang:latest as builder
WORKDIR /build
COPY . .
RUN set -ex \
&& go get -d -v \
&& CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM scratch
WORKDIR /
COPY --from=builder /build/app .
USER 1000
CMD ["./app"]