Dockerfile 903 B

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