-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (35 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
# tini
FROM --platform=${BUILDPLATFORM} alpine:3.19 as tini
LABEL maintainer="chalk@chalk-is.me"
# environment
ARG TINI_VERSION=v0.19.0
ARG TARGETPLATFORM
# install tini
RUN case ${TARGETPLATFORM} in \
"linux/amd64") TINI_ARCH=amd64 ;; \
"linux/arm64") TINI_ARCH=arm64 ;; \
"linux/arm/v7") TINI_ARCH=armhf ;; \
esac \
&& wget -q https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TINI_ARCH} -O /tini \
&& chmod +x /tini
# final image
FROM alpine:3.19
LABEL maintainer="chalk@chalk-is.me"
# environment
ARG SYNC_REPO
ARG SYNC_BRANCH
ENV GITSYNC_REPO=${SYNC_REPO}
ENV GITSYNC_REF=${SYNC_BRANCH}
ENV GITSYNC_ROOT=/config-sync
ENV GITSYNC_LINK=${SYNC_BRANCH}
ENV GITSYNC_MAX_FAILURES=3
# install git
RUN apk add --no-cache git
# inject built files
COPY --from=tini /tini /sbin/tini
COPY --from=registry.k8s.io/git-sync/git-sync:v4.2.1 /git-sync /sbin/git-sync
# inject entrypoint
COPY docker-entrypoint.sh /docker-entrypoint.sh
# let's go!
ENTRYPOINT [ "/sbin/tini", "--", "/docker-entrypoint.sh" ]
CMD [ "/sbin/git-sync" ]