docker-volume-backup/Dockerfile
Frederik Ring f64aaa6e24
Allow backup to be run as non-root user (#366)
* Allow backup to be run as non-root user

* Document usage as non-root user

* Also test /etc access

* Choose better name for doc
2024-02-21 17:44:24 +01:00

22 lines
424 B
Docker

# Copyright 2021 - Offen Authors <hioffen@posteo.de>
# SPDX-License-Identifier: MPL-2.0
FROM golang:1.22-alpine as builder
WORKDIR /app
COPY . .
RUN go mod download
WORKDIR /app/cmd/backup
RUN go build -o backup .
FROM alpine:3.19
WORKDIR /root
RUN apk add --no-cache ca-certificates && \
chmod a+rw /var/lock
COPY --from=builder /app/cmd/backup/backup /usr/bin/backup
ENTRYPOINT ["/usr/bin/backup", "-foreground"]