2018-11-07 10:43:48 +01:00
|
|
|
FROM alpine:latest
|
2014-10-16 22:08:13 +02:00
|
|
|
MAINTAINER Adrian Dvergsdal [atmoz.net]
|
2014-10-07 21:34:24 +02:00
|
|
|
|
2017-10-08 18:36:51 +02:00
|
|
|
# Steps done in one RUN layer:
|
2016-06-02 14:56:30 +02:00
|
|
|
# - Install packages
|
2016-07-31 15:39:11 +02:00
|
|
|
# - Fix default group (1000 does not exist)
|
2016-06-02 14:56:30 +02:00
|
|
|
# - OpenSSH needs /var/run/sshd to run
|
|
|
|
# - Remove generic host keys, entrypoint generates unique keys
|
2016-09-03 17:52:14 +02:00
|
|
|
RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
|
|
|
|
apk add --no-cache bash shadow@community openssh openssh-sftp-server && \
|
2016-07-31 15:39:11 +02:00
|
|
|
sed -i 's/GROUP=1000/GROUP=100/' /etc/default/useradd && \
|
2016-06-02 14:56:30 +02:00
|
|
|
mkdir -p /var/run/sshd && \
|
2016-07-31 15:39:11 +02:00
|
|
|
rm -f /etc/ssh/ssh_host_*key*
|
2014-10-07 21:34:24 +02:00
|
|
|
|
2018-11-16 01:02:50 +01:00
|
|
|
COPY files/sshd_config /etc/ssh/sshd_config
|
|
|
|
COPY files/create-sftp-user /usr/local/bin/
|
|
|
|
COPY files/entrypoint /
|
2014-10-07 21:34:24 +02:00
|
|
|
|
|
|
|
EXPOSE 22
|
|
|
|
|
2014-12-31 16:35:46 +01:00
|
|
|
ENTRYPOINT ["/entrypoint"]
|