forked from selim13/docker-automysqlbackup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (36 loc) · 1.07 KB
/
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
37
38
39
40
41
42
43
44
45
# Build
FROM golang:1.9 as builder
RUN go get -d -v github.com/odise/go-cron
WORKDIR /go/src/github.com/odise/go-cron
RUN CGO_ENABLED=0 GOOS=linux go build -o go-cron bin/go-cron.go
# Package
FROM alpine:3.6
MAINTAINER Dmitry Seleznyov <[email protected]>
RUN apk add --no-cache mysql-client
COPY --from=builder /go/src/github.com/odise/go-cron/go-cron /usr/local/bin
COPY start.sh /usr/local/bin
COPY automysqlbackup /usr/local/bin
RUN chmod +x /usr/local/bin/go-cron /usr/local/bin/automysqlbackup /usr/local/bin/start.sh
RUN mkdir -p /etc/default
VOLUME /backup
WORKDIR /backup
ENV USERNAME= \
PASSWORD= \
DBHOST=localhost \
DBNAMES=all \
BACKUPDIR="/backup" \
MDBNAMES= \
DBEXCLUDE="" \
CREATE_DATABASE=yes \
SEPDIR=yes \
DOWEEKLY=6 \
COMP=gzip \
COMMCOMP=no \
LATEST=no \
MAX_ALLOWED_PACKET= \
SOCKET= \
PREBACKUP= \
POSTBACKUP= \
ROUTINES=yes \
CRON_SCHEDULE=
CMD ["start.sh"]