-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
45 lines (34 loc) · 1.06 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
FROM alpine as goBuild
LABEL AUTHOR="iouAkira <ZS5ha2ltb3RvLmFraXJhQGdtYWlsLmNvbQ==>"
RUN set -ex \
&& apk update \
&& apk upgrade \
&& apk add --no-cache go git
RUN set -ex \
&& cd / \
&& git clone https://github.com/iouAkira/iou-base.git \
&& cd /iou-base/repo_sync \
&& go build repo_sync.go
FROM alpine
LABEL AUTHOR="iouAkira <ZS5ha2ltb3RvLmFraXJhQGdtYWlsLmNvbQ==>"
ENV VER=0.1 \
MNT_DIR=/data \
REPOS_DIR=/iouRepos \
LOCAL_DIR=/iouLocalDir \
CRON_FILE_DIR=/iouCron
RUN set -ex \
&& apk update && apk upgrade\
&& apk add --no-cache tzdata git jq\
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& mkdir /data \
&& mkdir /iouCron \
&& mkdir /iouRepos
COPY --from=goBuild /iou-base/repo_sync/repo_sync /usr/local/bin/repo_sync
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/repo_sync \
&& chmod +x /usr/local/bin/entrypoint.sh
VOLUME [ "/data" ]
WORKDIR /iouRepos
ENTRYPOINT ["entrypoint.sh"]
CMD ["keep-run"]