You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to understand how the directive RUN --mount=type=bind works and for the life of me I cannot understand what am I doing wrong.
Here is my Dockerfile
ARG BASE_IMAGE=python:3.11-slim
# define an alias for the specfic python version used in this file.FROM ${BASE_IMAGE} as python
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
PYSETUP_PATH="/opt/pysetup" \
POETRY_HOME="/opt/pysetup/poetry" \
POETRY_CACHE_DIR="/opt/pysetup/poetry_cache" \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=true \
VENV_PATH="/opt/pysetup/.venv" \
POETRY_VERSION="1.3.2"ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"WORKDIR $PYSETUP_PATH
# Install apt packagesRUN apt-get update && apt-get install --no-install-recommends -y \
# dependencies for building Python packages
build-essential \
curl \
# cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* \
# Install poetry
&& curl -sSL https://install.python-poetry.org | python -
# Install base requirementsCOPY poetry.lock pyproject.toml ./
RUN --mount=type=bind,source=.,target=/opt/pysetup/poetry,rw poetry install --no-root --only main
ENV VIRTUAL_ENV="${VENV_PATH}" \
POETRY_VIRTUALENVS_CREATE=false
building it results in /bin/sh poetry ...---> not found can anyone please explain what am I doing wrong?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am trying to understand how the directive
RUN --mount=type=bind
works and for the life of me I cannot understand what am I doing wrong.Here is my Dockerfile
building it results in
/bin/sh poetry ...---> not found
can anyone please explain what am I doing wrong?Beta Was this translation helpful? Give feedback.
All reactions