diff options
author | 2021-01-09 17:24:07 -0800 | |
---|---|---|
committer | 2021-01-09 17:24:07 -0800 | |
commit | aba2caaa40832bcef3958214f0d88bd841134f2e (patch) | |
tree | 4b1c5531d5d8e6043cc0c07d21131942929e80b9 /Dockerfile | |
parent | Document how to install additional packages (diff) |
Prevent setting GIT_SHA from invalidating the Docker layer cache
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -35,13 +35,11 @@ RUN chmod +x /usr/sbin/nsjail FROM base as venv ARG DEV -ARG git_sha="development" ENV PIP_NO_CACHE_DIR=false \ PIPENV_DONT_USE_PYENV=1 \ PIPENV_HIDE_EMOJIS=1 \ PIPENV_NOSPIN=1 \ - GIT_SHA=$git_sha \ PYTHONUSERBASE=/snekbox/user_base COPY Pipfile Pipfile.lock /snekbox/ @@ -55,6 +53,7 @@ RUN if [ -n "${DEV}" ]; \ fi # At the end to avoid re-installing dependencies when only a config changes. +# It's in the venv image because the final image is not used during development. COPY config/ /snekbox/config FROM venv @@ -64,3 +63,7 @@ CMD ["-c", "config/gunicorn.conf.py", "snekbox.api.app"] COPY . /snekbox WORKDIR /snekbox + +# At the end to prevent it from invalidating the layer cache. +ARG git_sha="development" +ENV GIT_SHA=$git_sha |