chore(Docker): add docker support

This commit is contained in:
Yukine 2021-02-04 00:30:37 +01:00
parent 80fdeb1320
commit 07237f62c8
No known key found for this signature in database
GPG Key ID: 6AE0B5764F0126D1
2 changed files with 25 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
Dockerfile
.gitignore
LICENSE.md
README.md

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM golang:alpine AS build-base
WORKDIR /tmp/DigitalOceanSnapshotter
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY cmd ./cmd
RUN go build -o ./out ./cmd/DigitalOceanSnapshotter
FROM alpine:3.9
RUN apk add ca-certificates
COPY --from=build-base /tmp/DigitalOceanSnapshotter/out /app/DigitalOceanSnapshotter
RUN ["chmod", "+x", "/app/DigitalOceanSnapshotter"]
CMD ["/app/DigitalOceanSnapshotter"]