Skip to content

Commit 3a0bda0

Browse files
committed
Add health check to Dockerfile for SSH daemon
This update introduces a HEALTHCHECK instruction to the Dockerfile, ensuring that the SSH daemon is running properly. The health check runs every 30 seconds and verifies the process is active, enhancing the reliability of the Docker image.
1 parent 6930844 commit 3a0bda0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ LABEL org.opencontainers.image.title="serversideup/docker-ssh" \
5353
org.opencontainers.image.version="${REPOSITORY_BUILD_VERSION}" \
5454
org.opencontainers.image.licenses="GPL-3.0-or-later"
5555

56+
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 \
57+
CMD pgrep -f "sshd.*-D" > /dev/null || exit 1
5658

5759
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
5860
CMD ["/usr/sbin/sshd", "-D", "-e"]

0 commit comments

Comments
 (0)