forked from databacker/mysql-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
24 lines (17 loc) · 604 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
# mysql backup image
FROM golang:1.21.5-alpine3.19 as build
COPY . /src/mysql-backup
WORKDIR /src/mysql-backup
RUN mkdir /out && go build -o /out/mysql-backup .
# we would do from scratch, but we need basic utilities in order to support pre/post scripts
FROM alpine:3.17
LABEL org.opencontainers.image.authors="https://github.com/databacker"
# set us up to run as non-root user
RUN apk add bash
RUN addgroup -g 1005 appuser && \
adduser -u 1005 -G appuser -D appuser
USER appuser
COPY --from=build /out/mysql-backup /mysql-backup
COPY entrypoint /entrypoint
# start
ENTRYPOINT ["/entrypoint"]