RobMcKiernan commented on issue #25085:
URL: https://github.com/apache/beam/issues/25085#issuecomment-1527212805
Yep, that worked! My new Dockerfile, in case it helps anyone:
```
# This image is just a thin wrapper around the standard python10 slim image.
It should work just fine using the standard image
FROM eu.gcr.io/my-proj/python:3.10-slim
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY --from=apache/beam_python3.10_sdk:2.46.0 /opt/apache/beam
/opt/apache/beam
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_NO_INTERACTION=1 \
PATH=/usr/lib/google-cloud-sdk/bin:$PATH
WORKDIR /app
# -- Omitted Section to sort out my gcloud authentication, which I'm not
including out of paranoia --
RUN pip install --no-cache-dir \
poetry \
keyring \
keyrings.google-artifactregistry-auth
COPY ./pyproject.toml ./poetry.lock ./
# setting virtualenvs.create to false prevents poetry using venvs as
# beam >2.43 uses global python packages only
RUN poetry config virtualenvs.create false \
&& poetry install --no-cache --no-root --only main \
&& rm -rf /root/.cache
ENTRYPOINT ["/opt/apache/beam/boot"]
```
tl;dr for anyone skipping to the end: Make sure your python packages are
installed in `/usr/local/lib/python<version number>/site-packages` in your
docker container.
Cheers for your help everyone! Should I close, or would you like it kept
open? I guess at a minimum this should be documented somewhere.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]