From 488b478101f11fc7ce748b02c68d5a6f360db7c1 Mon Sep 17 00:00:00 2001 From: Shrike <107105450+shrikeinfosec@users.noreply.github.com> Date: Fri, 23 Sep 2022 11:41:02 +0100 Subject: [PATCH 1/2] Move wait-for-it.sh to $PATH and make executable. Given that this script is used internally as part of the docker image, it makes sense to ensure it is added to the path directly within the Dockerfile itself, rather than from the docker-compose.yml file. It also needs to be made executable, otherwise the entrypoint command within the docker-compose.yml file will not be able to run it. --- web/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/Dockerfile b/web/Dockerfile index f2733b2..2edbe55 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -71,6 +71,9 @@ RUN ( \ # Add run script # Trigger to perform first boot operations ADD run.sh /run.sh +# Ensure that wait for it is included in the path and executable +ADD wait-for-it.sh /usr/local/bin/wait-for-it.sh +RUN chmod +x /usr/local/bin/wait-for-it.sh RUN mv /etc/apache2/sites-available/misp-ssl.conf /etc/apache2/sites-available/misp-ssl.conf.bak ADD misp-ssl.conf /etc/apache2/sites-available/misp-ssl.conf RUN chmod 0755 /run.sh && touch /.firstboot.tmp From 9261b912c4466499ccf9eb8e5d83107fe8c22d52 Mon Sep 17 00:00:00 2001 From: Shrike <107105450+shrikeinfosec@users.noreply.github.com> Date: Fri, 23 Sep 2022 11:43:10 +0100 Subject: [PATCH 2/2] Remove wait-for-it from docker-compose.yml Given that the script is used internally, it should be added to the Dockerfile, not the docker-compose.yml. Trying to include it from the docker-compose.yml file means that you might run into issues where it is not executable, and therefore the entrypoint command cannot run it (as it won't exist as an executable). --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3c2f991..a19d557 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,6 @@ services: - "80:80" - "443:443" volumes: - - ./web/wait-for-it.sh:/usr/local/bin/wait-for-it.sh:ro - /dev/urandom:/dev/random - ${DATA_DIR:-./data}/web:/var/www/MISP environment: