-
Notifications
You must be signed in to change notification settings - Fork 32
/
Dockerfile
60 lines (52 loc) · 1.55 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM alpine:latest
MAINTAINER tynor88 <[email protected]>
# global environment settings
ENV PLATFORM_ARCH="amd64"
ARG RCLONE_VERSION="current"
# s6 environment settings
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=2
ENV S6_KEEP_ENV=1
# install packages
RUN \
apk update && \
apk add --no-cache \
ca-certificates
# install build packages
RUN \
apk add --no-cache --virtual=build-dependencies \
wget \
curl \
unzip && \
# add s6 overlay
OVERLAY_VERSION=$(curl -sX GET "https://api.github.com/repos/just-containers/s6-overlay/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
curl -o \
/tmp/s6-overlay.tar.gz -L \
"https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${PLATFORM_ARCH}.tar.gz" && \
tar xfz \
/tmp/s6-overlay.tar.gz -C / && \
cd tmp && \
wget -q https://downloads.rclone.org/v${RCLONE_VERSION}/rclone-v${RCLONE_VERSION}-linux-${PLATFORM_ARCH}.zip && \
unzip /tmp/rclone-v${RCLONE_VERSION}-linux-${PLATFORM_ARCH}.zip && \
mv /tmp/rclone-*-linux-${PLATFORM_ARCH}/rclone /usr/bin && \
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
shadow && \
# cleanup
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
/var/tmp/* \
/var/cache/apk/*
# create abc user
RUN \
groupmod -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
# create some files / folders
mkdir -p /config /app /defaults /data && \
touch /var/lock/rclone.lock
# add local files
COPY root/ /
VOLUME ["/config"]
ENTRYPOINT ["/init"]