Skip to content

Commit

Permalink
Add Tini tooling to ensure graceful shutdown of the Docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
catalan-adobe committed Feb 1, 2019
1 parent b4b34bb commit 60ceb83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ RUN selenium-standalone install
ADD ./scripts/ /home/seluser/scripts


# Add Tini for graceful shutdown
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]


# Force using non root user to execute the image
USER seluser

Expand All @@ -106,4 +113,5 @@ HEALTHCHECK --start-period=5s --interval=3s --retries=8 \
CMD curl -qsf "$SELENIUM_CONSOLE_URL/status" | jq -r '.value.ready' | grep "true" || exit 1


ENTRYPOINT ["sh", "/home/seluser/scripts/start.sh"]
# Run our start script under Tini
CMD ["/home/seluser/scripts/start.sh"]
2 changes: 1 addition & 1 deletion docker/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

. /home/seluser/scripts/utils.sh && print_selenium_env

Expand Down

0 comments on commit 60ceb83

Please sign in to comment.