-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (49 loc) · 1.74 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
FROM alpine:3
LABEL org.opencontainers.image.description="An S3 SFTP-enabled file system bridge."
LABEL org.opencontainers.image.vendor="The Concourse Group Inc DBA MetaBronx"
LABEL org.opencontainers.image.authors="Elias Gabriel <[email protected]>"
LABEL org.opencontainers.image.source="https://github.com/metabronx/blackstrap_s3"
# LABEL org.opencontainers.image.licenses="MIT"
RUN apk upgrade && \
apk --no-cache add \
shadow \
bash \
openssh \
fuse \
libxml2 \
libcurl \
libgcc \
libstdc++ \
tini && \
## create ssh user
useradd -U -s /bin/bash -d /home/blackstrap-user \
blackstrap-user && \
passwd -u -d blackstrap-user && \
## configure ssh
### in a real world circumstance, this line is a _very_ bad idea. but this
### container will only ever run locally, so it doesn't really matter.
chmod 666 /etc/shadow && \
chown -R blackstrap-user:blackstrap-user /etc/ssh && \
echo 'set +o history' >> /etc/profile && \
# configure s3fs
mkdir -p /opt/s3fs /home/blackstrap-user && \
chown -R blackstrap-user:blackstrap-user /opt/s3fs /home/blackstrap-user && \
echo "user_allow_other" >> /etc/fuse.conf
USER blackstrap-user
COPY --from=efrecon/s3fs:1.93 \
/usr/local/bin/healthcheck.sh \
/usr/local/bin/trap.sh \
/usr/local/bin/
COPY --from=efrecon/s3fs:1.93 /usr/bin/s3fs /usr/bin/s3fs
COPY ./motd.txt /etc/motd
COPY ./sshd_config /etc/ssh/sshd_config
COPY ./entrypoint.sh /entrypoint.sh
COPY ./sshd.sh /sshd.sh
HEALTHCHECK \
--interval=15s \
--timeout=5s \
--start-period=15s \
--retries=2 \
CMD [ "/usr/local/bin/healthcheck.sh" ]
ENTRYPOINT [ "tini", "-g", "--", "/entrypoint.sh" ]
CMD [ "/sshd.sh" ]