-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (35 loc) · 1.52 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# syntax=docker/dockerfile:1.9
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: 2025 Univention GmbH
# Inspired by: https://hynek.me/articles/docker-uv/
ARG UCS_BASE_IMAGE_TAG=0.16.1-2025-02-14@sha256:8c25ce5b41977cb59b1e5da1363a4320d985a77d6903d2d9b0dfee1afc1fd22c
ARG UCS_BASE_IMAGE=gitregistry.knut.univention.de/univention/components/ucs-base-image/ucs-base-python-520
FROM ${UCS_BASE_IMAGE}:${UCS_BASE_IMAGE_TAG} AS build
SHELL ["/bin/bash", "-uxo", "pipefail", "-c"]
COPY --from=ghcr.io/astral-sh/uv:0.5.8@sha256:0bc959d4cc56e42cbd9aa9b63374d84481ee96c32803eea30bd7f16fd99d8d56 /uv /usr/local/bin/uv
COPY --from=alpine/helm:3.17.1@sha256:e8d29e13b8218a8cb7b117a10a5210922474a74467bf70b6f3f1f7d9c1818ab0 /usr/bin/helm /usr/local/bin/helm
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
UV_PYTHON=python3.11 \
PYTHONUNBUFFERED=1 \
PATH=/app/helm-test-harness/.venv/bin:$PATH
COPY ./pytest-helm /app/pytest-helm
COPY ./helm-test-harness/uv.lock \
./helm-test-harness/pyproject.toml \
/app/helm-test-harness/
WORKDIR /app/helm-test-harness
RUN --mount=type=cache,target=/root/.cache \
uv sync \
--locked \
--no-dev \
--no-install-project && \
uv export -o ./requirements.txt
# copy source code
COPY ./helm-test-harness/univention /app/helm-test-harness/univention
# RUN uv sync --locked --no-dev --no-editable
CMD ["pytest"]
RUN \
.venv/bin/python3.11 -V && \
.venv/bin/python3.11 -m site && \
.venv/bin/python3.11 -c 'import univention.testing.helm'