mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-04-22 00:22:40 +02:00
try porting docker related parts to golang
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -2,8 +2,11 @@
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
FROM golang:1.17-alpine as builder
|
||||
ARG MC_VERSION=RELEASE.2021-06-13T17-48-22Z
|
||||
RUN go install -ldflags "-X github.com/minio/mc/cmd.ReleaseTag=$MC_VERSION" github.com/minio/mc@$MC_VERSION
|
||||
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
COPY src/main.go ./src/main.go
|
||||
RUN go build -o backup src/main.go
|
||||
|
||||
FROM alpine:3.14
|
||||
|
||||
@@ -13,11 +16,9 @@ RUN apk add --update ca-certificates docker openrc gnupg
|
||||
RUN update-ca-certificates
|
||||
RUN rc-update add docker boot
|
||||
|
||||
COPY --from=builder /go/bin/mc /usr/bin/mc
|
||||
RUN mc --version
|
||||
COPY --from=builder /app/backup /usr/bin/backup
|
||||
|
||||
COPY src/backup.sh src/entrypoint.sh /root/
|
||||
RUN chmod +x backup.sh && mv backup.sh /usr/bin/backup \
|
||||
&& chmod +x entrypoint.sh
|
||||
COPY src/entrypoint.sh /root/
|
||||
RUN chmod +x entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/root/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user