From e9f9c1ec5da2433ef95b23d7526d69458e01ad3c Mon Sep 17 00:00:00 2001 From: Bruno Tavares Date: Thu, 11 Apr 2019 22:43:52 -0300 Subject: [PATCH] Copy project into image instead of cloning Docker `RUN` statements cache based on the text of the command executed, not the content of what it does to the image. Since the command was cloning the project, and the text didn't change, building the image would not update the code if the image was already cached. This lead to a stale Docker image distributed on Docker Hub. This could also cause some confusion, as modified code would not show up on the image during the build process. This commit changes the build process to copy the content of the project into the image. Whenever a file changes it will trigger a new updated image. --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5683cad..c53e5c7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,8 +45,8 @@ RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \ && chown -R pptruser:pptruser /node_modules # Install the ArchiveBox repository and pip requirements -RUN git clone https://github.com/pirate/ArchiveBox /home/pptruser/app \ - && mkdir -p /data \ +COPY . /home/pptruser/app +RUN mkdir -p /data \ && chown -R pptruser:pptruser /data \ && ln -s /data /home/pptruser/app/archivebox/output \ && ln -s /home/pptruser/app/bin/* /bin/ \