Skip to content

Commit 7224bd2

Browse files
committed
gemini suggestions
1 parent 7d9a577 commit 7224bd2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

sdks/python/container/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ RUN \
5151

5252
# Install required packages for Beam Python SDK and common dependencies used by users.
5353
# use --no-deps to ensure the list includes all transitive dependencies.
54-
uv pip install --no-deps -r /tmp/base_image_requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu --system --index-strategy "unsafe-best-match" && \
54+
uv pip install --no-cache --no-deps -r /tmp/base_image_requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu --system --index-strategy "unsafe-best-match" && \
5555
rm -rf /tmp/base_image_requirements.txt && \
5656
python -c "import nltk; nltk.download('stopwords')" && \
5757
rm /root/nltk_data/corpora/stopwords.zip && \
@@ -75,21 +75,21 @@ RUN \
7575

7676
# Install Apache Beam SDK. Use --no-deps and pip check to verify that all
7777
# necessary dependencies are specified in base_image_requirements.txt.
78-
uv pip install --no-deps -v /opt/apache/beam/tars/apache-beam.tar.gz[gcp] --system && \
79-
uv pip check || (echo "Container does not include required Beam dependencies or has conflicting dependencies. If Beam dependencies have changed, you need to regenerate base_image_requirements.txt files. See: https://s.apache.org/beam-python-requirements-generate" && exit 1) && \
78+
uv pip install --no-cache --no-deps -v /opt/apache/beam/tars/apache-beam.tar.gz[gcp] --system && \
79+
uv pip check --system || (echo "Container does not include required Beam dependencies or has conflicting dependencies. If Beam dependencies have changed, you need to regenerate base_image_requirements.txt files. See: https://s.apache.org/beam-python-requirements-generate" && exit 1) && \
8080

8181
# Log complete list of what exact packages and versions are installed.
82-
uv pip freeze && \
82+
uv pip freeze --system && \
8383

8484
# Remove pip cache.
8585
rm -rf /root/.cache/pip && \
8686

8787
# Update ensurepip to use most recent versions of setuptools and pip. This avoids some vulnerabilities which won't be fixed on older versions of python.
88-
uv pip install upgrade_ensurepip --system; \
88+
uv pip install --no-cache upgrade_ensurepip --system; \
8989
python3 -m upgrade_ensurepip; \
9090
find /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-*-py3-none-any.whl | tail -n 1)) -delete; \
9191
find /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-*-py3-none-any.whl | tail -n 1)) -delete; \
92-
uv pip uninstall upgrade_ensurepip -y --system; \
92+
uv pip uninstall upgrade_ensurepip --system; \
9393
python3 -m ensurepip;
9494

9595
ENTRYPOINT ["/opt/apache/beam/boot"]
@@ -109,7 +109,7 @@ COPY target/go-licenses/* /opt/apache/beam/third_party_licenses/golang/
109109

110110
COPY target/license_scripts /tmp/license_scripts/
111111
RUN if [ "$pull_licenses" = "true" ] ; then \
112-
uv pip install 'pip-licenses<6' pyyaml tenacity --system && \
112+
uv pip install --no-cache 'pip-licenses<6' pyyaml tenacity --system && \
113113
python /tmp/license_scripts/pull_licenses_py.py ; \
114114
fi
115115

0 commit comments

Comments
 (0)