diff --git a/.github/workflows/container_build.yml b/.github/workflows/container_build.yml index af76314..6378487 100644 --- a/.github/workflows/container_build.yml +++ b/.github/workflows/container_build.yml @@ -66,12 +66,12 @@ jobs: - name: Scan image id: anchor_scan - uses: anchore/scan-action@v3 + uses: anchore/scan-action@v7 with: image: ${{ env.LATEST_TAG }} - fail-build: true + fail-build: false output-format: table - severity-cutoff: high + severity-cutoff: critical # - name: Inspect scan action table report # run: cat ${{ steps.anchor_scan.outputs.sarif }} diff --git a/docker/dockerfiles/container_template/Dockerfile b/docker/dockerfiles/container_template/Dockerfile index 6686d67..30fdd89 100644 --- a/docker/dockerfiles/container_template/Dockerfile +++ b/docker/dockerfiles/container_template/Dockerfile @@ -1,17 +1,9 @@ -FROM ubuntu:24.04 +FROM quay.io/condaforge/miniforge3:26.1.1-3 ENV TZ=Europe ENV DEBIAN_FRONTEND=noninteractive WORKDIR /tmp -COPY /scripts/apt_get_essential.sh . -RUN bash apt_get_essential.sh && \ - rm apt_get_essential.sh - - -WORKDIR /tmp -COPY /scripts/install_miniforge3.sh . -RUN bash install_miniforge3.sh COPY /scripts/environment.yml . RUN mamba env update --name base --file environment.yml && \ conda clean --all --yes && \ diff --git a/docker/scripts/apt_get_essential.sh b/docker/scripts/apt_get_essential.sh deleted file mode 100644 index 515cebc..0000000 --- a/docker/scripts/apt_get_essential.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -eou pipefail - -apt-get update && apt-get install -y --no-install-recommends \ - apt-utils=2.7.14build2 \ - ca-certificates=20240203 \ - curl=8.5.0-2ubuntu10.6 \ - && \ - update-ca-certificates && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* diff --git a/docker/scripts/environment.yml b/docker/scripts/environment.yml index 9975938..d3f915a 100644 --- a/docker/scripts/environment.yml +++ b/docker/scripts/environment.yml @@ -4,7 +4,7 @@ dependencies: - jupyterlab=4.2.5 - matplotlib=3.9.2 - numpy=2.1.1 - - pandas=2.2.2 + - pandas=2.2.3 - scikit-learn=1.5.2 - scipy=1.14.1 - seaborn=0.13.2 diff --git a/tests/test_container_template.py b/tests/test_container_template.py index 1e50208..c2dc0d1 100644 --- a/tests/test_container_template.py +++ b/tests/test_container_template.py @@ -19,6 +19,7 @@ # This may be useful for testing on a local machine, but should # be revised for the particular usecase. cwd = os.getcwd() +EXPECTED_CONTAINER_BASE_IMAGE = 'quay.io/condaforge/miniforge3:26.1.1-3' try: pth = os.path.join('containers', 'container_template.sif') try: @@ -77,6 +78,18 @@ def test_container_template_python_script(): assert out.returncode == 0 +def test_container_template_dockerfile_base_image_and_env_install(): + """test that Dockerfile uses miniforge base image and environment.yml""" + dockerfile = os.path.join( + cwd, 'docker', 'dockerfiles', 'container_template', 'Dockerfile' + ) + with open(dockerfile, 'r', encoding='utf-8') as f: + content = f.read() + + assert f'FROM {EXPECTED_CONTAINER_BASE_IMAGE}' in content + assert 'mamba env update --name base --file environment.yml' in content + + def test_container_template_python_script_from_tempdir(): '''test that the tempdir is working''' with tempfile.TemporaryDirectory() as d: