I'm trying to build a base image for the pipeline with pre-installed dependencies. I'm using a multistage build approach in a Dockerfile like this:
base.dockerfile
FROM python:$PYTHON_BASE AS base
RUN deps="" \
&& apt update \
&& apt-get install -y --no-install-recommends $deps
FROM base AS building-python-dependencies
WORKDIR /app
RUN <<EOF
set -ex
pip install -U pdm \
&& pdm install --frozen-lockfile --no-editable # This create the .venv (Confirmed)
EOF
FROM base as final
COPY --from=building-python-dependencies /app/.venv /app/.venv # This step fail
ENV PATH=/app/.venv/bin:$PATH \
PYTHONPATH=/app/.venv/lib/python3.11/site-packages
I encounter the following error during the build process:
Step 16/19 : COPY --from=building-python-dependencies /app/.venv /app/.venv
Service 'base' failed to build: COPY failed: stat app/.venv: file does not exist
Hi Fabián,
I'd suggest testing this locally in a Docker container to see if you receive the same error - and adjusting the path if necessary, typically this error would indicate an issue with the path used when copying.
If you still require further assistance - we'd need to take a closer look at your build environment. To do so - our system requires a support ticket. As you are a Premium customer - you are entitled to formal support from our support team, you may raise a ticket below:
If you have issues raising a ticket - please let me know your timezone so I can raise one on your behalf with the appropriate team.
Cheers!
- Ben (Bitbucket Cloud Support)
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.