From cc62ab6919cb1826ec66bf7e02c3ecb15f88e5ad Mon Sep 17 00:00:00 2001 From: Reijer Copier Date: Wed, 20 Oct 2021 15:37:30 +0200 Subject: [PATCH 1/2] Fix broken (due to upstream changes) multistage build --- Dockerfile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e36377..b95da45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8-slim AS base +FROM python:3.8-slim # We choose python-slim instead of alpine, a buildspeed vs image size tradeoff. # In case you need base debian dependencies install them here. @@ -6,8 +6,6 @@ FROM python:3.8-slim AS base # # TODO list depencies here \ # && apt-get clean && rm -rf /var/lib/apt/lists/* -# --- COMPILE-IMAGE --- -FROM base AS compile-image ENV DEBIAN_FRONTEND=noninteractive # Install dev dependencies @@ -40,14 +38,8 @@ RUN pipenv --rm && \ PIPENV_VENV_IN_PROJECT=1 pipenv --three && \ pipenv sync -# --- BUILD IMAGE --- -FROM base AS build-image WORKDIR /code -COPY --from=compile-image "/code/linkage_checker.egg-info/" "/code/linkage_checker.egg-info/" -COPY --from=compile-image "/code/linkage_checker" "/code/linkage_checker" -COPY --from=compile-image /code/.venv /code/.venv - # Make sure we use the virtualenv: ENV PATH="/code/.venv/bin:$PATH" From 7314983796fa9595f34a3a0f9bc519d3d8e3b1fa Mon Sep 17 00:00:00 2001 From: Reijer Copier Date: Wed, 20 Oct 2021 16:14:28 +0200 Subject: [PATCH 2/2] Remove redundant installation steps --- Dockerfile | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index b95da45..8b63e17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,22 +21,10 @@ RUN pip install --no-cache-dir pipenv WORKDIR /code COPY . /code -# Install packages, including the dev (test) packages. +# Install packages RUN PIPENV_VENV_IN_PROJECT=1 pipenv --three RUN pipenv lock -RUN pipenv sync --dev - -# Run pytest tests. -# pipenv check fails due to a github connection error. Pipenv check scans for python -# vulnerabilities amongst other things. We might want to debug and fix this: -# RUN PIPENV_PYUP_API_KEY="" pipenv check && -#RUN pipenv run pytest - -# Cleanup test packages. We want to use pipenv uninstall --all-dev but that command is -# broken. See: https://github.com/pypa/pipenv/issues/3722 -RUN pipenv --rm && \ - PIPENV_VENV_IN_PROJECT=1 pipenv --three && \ - pipenv sync +RUN pipenv sync WORKDIR /code