forked from sbaerlocher/docker.autossh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (26 loc) · 980 Bytes
/
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
FROM alpine:latest
LABEL "maintainer"="Simon Baerlocher <[email protected]>" \
"org.opencontainers.image.authors"="Simon Baerlocher <[email protected]>" \
"org.opencontainers.image.vendor"="sbaerlocher" \
"org.opencontainers.image.licenses"="MIT" \
"org.opencontainers.image.url"="https://github.com/sbaerlocher/docker.autossh" \
"org.opencontainers.image.documentation"="https://github.com/sbaerlocher/docker.autossh" \
"org.opencontainers.image.source"="https://github.com/sbaerlocher/docker.autossh"
ENV \
USER=ssh \
GROUP=ssh \
UID=1000 \
GID=1000
RUN apk add --no-cache \
autossh
RUN set -eux \
&& addgroup -g ${GID} ${GROUP} \
&& adduser -h /home/${USER} -s /bin/bash -G ${GROUP} -D -u ${UID} ${USER} \
\
&& mkdir /home/${USER}/.ssh \
&& chown ssh:ssh /home/${USER}/.ssh \
&& chmod 0700 /home/${USER}/.ssh
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
USER ssh
CMD ["/usr/local/bin/entrypoint.sh"]