0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2025-03-09 15:16:00 -04:00
atmoz-sftp/Dockerfile-alpine

31 lines
956 B
Text
Raw Normal View History

FROM alpine:latest
MAINTAINER Adrian Dvergsdal [atmoz.net]
# Steps done in one RUN layer:
# - Install packages
# - OpenSSH needs /var/run/sshd to run
# - Remove generic host keys, entrypoint generates unique keys
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* && \
apk --no-cache add dos2unix
COPY files/sshd_config /etc/ssh/sshd_config
COPY files/create-sftp-user /usr/local/bin/
COPY files/entrypoint /
2023-04-26 07:56:07 +07:00
RUN dos2unix /etc/ssh/sshd_config && \
dos2unix /usr/local/bin/create-sftp-user && \
dos2unix /entrypoint
2023-04-26 07:56:07 +07:00
RUN chmod +x /entrypoint && \
chmod +x /usr/local/bin/create-sftp-user
2023-04-26 07:56:07 +07:00
RUN apk del dos2unix --force-broken-world --progress
EXPOSE 22
ENTRYPOINT ["/entrypoint"]