|
| 1 | +# syntax=docker/dockerfile:1 |
| 2 | + |
| 3 | +ARG BASE_IMAGE=ghcr.io/philips-software/amp-devcontainer-base:edge |
| 4 | +FROM ${BASE_IMAGE} |
| 5 | + |
| 6 | +ARG DEBIAN_FRONTEND=noninteractive |
| 7 | + |
| 8 | +HEALTHCHECK NONE |
| 9 | + |
| 10 | +SHELL ["/bin/bash", "-Eeuo", "pipefail", "-c"] |
| 11 | + |
| 12 | +# Set default environment options |
| 13 | +ENV PYTHONPYCACHEPREFIX=/cache/.python |
| 14 | + |
| 15 | +# Install the base system with all tool dependencies |
| 16 | +RUN --mount=type=bind,source=.devcontainer/docs/apt-requirements.json,target=/tmp/apt-requirements.json \ |
| 17 | + --mount=type=bind,source=.devcontainer/docs/requirements.txt,target=/tmp/requirements.txt \ |
| 18 | + --mount=type=cache,target=/cache,sharing=locked \ |
| 19 | + --mount=type=cache,target=/var/cache/apt,sharing=locked \ |
| 20 | + --mount=type=cache,target=/var/lib/apt,sharing=locked \ |
| 21 | + --mount=type=cache,target=/var/log,sharing=locked <<EOF |
| 22 | + |
| 23 | + # Install the base system with all tool dependencies |
| 24 | + apt-get update && jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements.json | \ |
| 25 | + xargs apt-get install -y --no-install-recommends |
| 26 | + |
| 27 | + # Install some tools via pip to get more recent versions, clean up afterwards |
| 28 | + python3 -m pip install --break-system-packages --require-hashes --no-cache-dir --no-compile -r /tmp/requirements.txt |
| 29 | + find / -regex '^.*\(__pycache__\|\.py[co]\)$' -delete |
| 30 | + rm -rf "$(pip cache dir)" |
| 31 | + |
| 32 | + # Update python alternative to the correct version |
| 33 | + update-alternatives --install /usr/bin/python python /usr/bin/python3 10 |
| 34 | +EOF |
0 commit comments