Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. FROM docker.io/alpine:3.17.0
  2. ARG MARIADB_CLIENT_PACKAGE_VERSION=10.6.10-r0
  3. ARG OPENSSH_SERVER_PACKAGE_VERSION=9.1_p1-r1
  4. ARG TINI_PACKAGE_VERSION=0.19.0-r1
  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_SERVER_PACKAGE_VERSION" \
  10. tini=$TINI_PACKAGE_VERSION \
  11. && adduser -S -s /bin/ash "$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 less man-db openssh-doc=$OPENSSH_SERVER_PACKAGE_VERSION
  16. COPY sshd_config /etc/ssh/sshd_config
  17. EXPOSE 2200/tcp
  18. ENV MYSQLDUMP_ARGS=
  19. COPY entrypoint.sh /
  20. ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
  21. USER $USER
  22. CMD ["/usr/sbin/sshd", "-D", "-e"]
  23. # https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md
  24. ARG REVISION=
  25. LABEL org.opencontainers.image.title="single-user openssh server executing mysqldump when client connects" \
  26. org.opencontainers.image.source="https://github.com/fphammerle/docker-mysqldump-sshd" \
  27. org.opencontainers.image.revision="$REVISION"