From 14c6ead389df61cd5694b91d0abfe3a83047923a Mon Sep 17 00:00:00 2001 From: Nick Reilingh Date: Sat, 11 Sep 2021 13:46:52 -0400 Subject: [PATCH 1/2] Dockerfile - comment misused VOLUME instructions Issuing a VOLUME instruction in a production Dockerfile requires the Docker engine to create a volume whether or not it is mapped to the host or a named volume. Neither of these paths have data that needs to be persisted for production use, so their inclusion under a typical `docker run` example forces the engine to create extraneous volumes which quickly become orphaned whenever the container is recreated. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index dcfb030b..ea1a6ea3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,9 +69,9 @@ RUN ln -s /etc/shlink/bin/cli /usr/local/bin/shlink EXPOSE 8080 # Expose params config dir, since the user is expected to provide custom config from there -VOLUME /etc/shlink/config/params +#VOLUME /etc/shlink/config/params # Expose data dir to allow persistent runtime data and SQLite db -VOLUME /etc/shlink/data +#VOLUME /etc/shlink/data # Copy config specific for the image COPY docker/docker-entrypoint.sh docker-entrypoint.sh From ef3c59152f6e8de03f4c3beb0da15b0690b4a79f Mon Sep 17 00:00:00 2001 From: Nick Reilingh Date: Sat, 11 Sep 2021 16:40:09 -0400 Subject: [PATCH 2/2] Dockerfile -- remove unneeded VOLUME instructions --- Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index ea1a6ea3..d2684545 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,11 +68,6 @@ RUN ln -s /etc/shlink/bin/cli /usr/local/bin/shlink # Expose default swoole port EXPOSE 8080 -# Expose params config dir, since the user is expected to provide custom config from there -#VOLUME /etc/shlink/config/params -# Expose data dir to allow persistent runtime data and SQLite db -#VOLUME /etc/shlink/data - # Copy config specific for the image COPY docker/docker-entrypoint.sh docker-entrypoint.sh COPY docker/config/shlink_in_docker.local.php config/autoload/shlink_in_docker.local.php