-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
36 lines (24 loc) · 894 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Use a mutli-stage build pipeline to generate the executable
FROM golang:1.23
ARG VERSION="development"
ENV GO_PATH="/go"
ADD . $GO_PATH/src/github.com/SierraSoftworks/minback-cleanup
WORKDIR $GO_PATH/src/github.com/SierraSoftworks/minback-cleanup
RUN go get -t ./...
RUN go test -v ./...
ENV CGO_ENABLED=0
ENV GOOS=linux
RUN go build -o bin/minback-cleanup -a -installsuffix cgo -ldflags "-s -X main.version=$VERSION"
# Build the actual container
FROM alpine:latest
LABEL maintainer="Benjamin Pannell <[email protected]>"
RUN apk add --update tini ca-certificates
COPY --from=0 /go/src/github.com/SierraSoftworks/minback-cleanup/bin/minback-cleanup /bin/minback-cleanup
LABEL VERSION=$VERSION
WORKDIR /bin
ENV MINIO_SERVER=""
ENV MINIO_BUCKET="backups"
ENV MINIO_ACCESS_KEY=""
ENV MINIO_SECRET_KEY=""
ENTRYPOINT ["/sbin/tini", "--", "/bin/minback-cleanup"]
CMD ["cleanup"]