-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (24 loc) · 892 Bytes
/
Dockerfile
File metadata and controls
28 lines (24 loc) · 892 Bytes
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
FROM alpine:latest
LABEL maintainer="Per Böhlin <per.bohlin@devconsoft.se>"
RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk add --no-cache \
bash \
shadow@community \
openssh-server-pam \
openssh-sftp-server \
&& ln -s /usr/sbin/sshd.pam /usr/sbin/sshd \
&& mkdir -p /var/run/sshd \
&& rm -f /etc/ssh/ssh_host_*key* \
&& mkdir -p /etc/ssh/sshd_host_keys \
&& chmod 700 /etc/ssh/sshd_host_keys \
&& groupadd --gid 101 upload \
&& useradd --non-unique --uid 100 --gid 101 upload \
&& usermod -p "*" upload \
&& mkdir -p /home/upload/.ssh \
&& chown -R 100:101 /home/upload \
&& chmod 755 /home/upload \
&& chmod 700 /home/upload/.ssh
COPY files/sshd_config /etc/ssh/sshd_config
COPY files/entrypoint.sh /
EXPOSE 22
ENTRYPOINT ["/entrypoint.sh"]