Dockerfile 919 B

1234567891011121314151617181920212223242526272829
  1. FROM alpine:3.13.4
  2. ARG MARIADB_CLIENT_PACKAGE_VERSION=10.5.8-r0
  3. ARG OPENSSH_PACKAGE_VERSION=8.4_p1-r3
  4. ARG TINI_PACKAGE_VERSION=0.19.0-r0
  5. ARG USER=dump
  6. ENV SSHD_HOST_KEYS_DIR=/etc/ssh/host_keys
  7. RUN apk add --no-cache \
  8. mariadb-client=$MARIADB_CLIENT_PACKAGE_VERSION \
  9. openssh-server=$OPENSSH_PACKAGE_VERSION \
  10. tini=$TINI_PACKAGE_VERSION \
  11. && adduser -S "$USER" \
  12. && mkdir "$SSHD_HOST_KEYS_DIR" \
  13. && chown -c "$USER" "$SSHD_HOST_KEYS_DIR"
  14. VOLUME $SSHD_HOST_KEYS_DIR
  15. # RUN apk add --no-cache man openssh-doc=$OPENSSH_PACKAGE_VERSION
  16. COPY entrypoint.sh /
  17. ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
  18. COPY sshd_config /etc/ssh/sshd_config
  19. EXPOSE 2200/tcp
  20. ENV MYSQLDUMP_ARGS --help
  21. RUN chmod a=rx /entrypoint.sh \
  22. && chmod a=r /etc/ssh/sshd_config \
  23. && sed -i 's#^\(dump:.*\):/sbin/nologin$#\1:/tmp/mysqldump.sh#' /etc/passwd
  24. USER $USER
  25. CMD ["/usr/sbin/sshd", "-D", "-e"]