]> git.arvados.org - arvados.git/blob - build/docker/python-venv.Dockerfile
23010: Uses new pg-formula supporting Ubuntu 24.04
[arvados.git] / build / docker / python-venv.Dockerfile
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4 #
5 # Build this with `build/build_docker_image.py`
6
7 FROM debian:bookworm-slim
8
9 RUN apt-get update -q \
10  && DEBIAN_FRONTEND=noninteractive apt-get install -qy python3-venv \
11  && python3 -m venv /opt/arvados-py
12
13 # The build script sets up our build context with all the Python source
14 # packages to install.
15 COPY . /usr/local/src/
16
17 RUN /opt/arvados-py/bin/pip install -qq --no-cache-dir --no-input \
18     -r /usr/local/src/requirements.txt
19
20 ### Stage 2
21 FROM debian:bookworm-slim
22 MAINTAINER Arvados Package Maintainers <packaging@arvados.org>
23 ARG APT_PKGLIST
24 ARG OLD_PKGNAME=python3-arvados-python-client
25
26 RUN apt-get update -q \
27  && DEBIAN_FRONTEND=noninteractive apt-get install -qy python3 $APT_PKGLIST
28
29 # The symlinks provide path compatibility with old package-based images.
30 RUN adduser --disabled-password --gecos 'Crunch execution user' crunch \
31  && install --directory --owner=crunch --group=crunch --mode=0700 \
32     /keep /tmp/crunch-src /tmp/crunch-job \
33  && ln -s /opt/arvados-py "/usr/lib/$OLD_PKGNAME"
34
35 USER crunch
36 ENV PATH=/opt/arvados-py/bin:/usr/local/bin:/usr/bin:/bin
37
38 COPY --from=0 /opt/arvados-py/ /opt/arvados-py/