archive
This commit is contained in:
22
restic/Dockerfile
Executable file
22
restic/Dockerfile
Executable file
@@ -0,0 +1,22 @@
|
||||
FROM golang:1.12.5-alpine3.9 as rbuilder
|
||||
|
||||
ENV GOPATH=/go
|
||||
RUN apk add --no-cache git bash ca-certificates
|
||||
RUN go get github.com/restic/restic
|
||||
WORKDIR /go/src/github.com/restic/restic/cmd/restic
|
||||
RUN git checkout v0.9.5
|
||||
RUN CGO_ENABLED=0 go build -o /go/bin/restic -a -installsuffix cgo
|
||||
|
||||
FROM alpine:3.9
|
||||
|
||||
WORKDIR /main
|
||||
RUN apk add --no-cache ca-certificates bash
|
||||
COPY --from=rbuilder /go/bin/ /main
|
||||
|
||||
VOLUME /mnt
|
||||
RUN echo \
|
||||
'out="$(/main/restic init /mnt 2>&1 | grep -v config.file.already.exists | grep -v created.restic.repository | tr -d "\\n" )"; if test -n "$out"; then printf "ERR: $out\n"; else exec /main/restic "$@"; fi' \
|
||||
> /entrypoint.sh \
|
||||
&& chmod +x /entrypoint.sh
|
||||
CMD []
|
||||
ENTRYPOINT ["bash", "/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user