Skip to content

Added dockerfile and workflow to build Docker image with baked-in five-safes profile#136

Open
EttoreM wants to merge 2 commits intodevelopfrom
135-add-release-triggered-github-actions-workflow-to-build-docker-image-with-baked-in-profiles
Open

Added dockerfile and workflow to build Docker image with baked-in five-safes profile#136
EttoreM wants to merge 2 commits intodevelopfrom
135-add-release-triggered-github-actions-workflow-to-build-docker-image-with-baked-in-profiles

Conversation

@EttoreM
Copy link
Contributor

@EttoreM EttoreM commented Mar 8, 2026

Closes #135

Added dockerfile and workflow to build Docker image with baked-in profiles when releasing new version of Cratey-Validator.

…files when releasing new version of Cratey-Validator
Copy link
Collaborator

@douglowe douglowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a couple of comments below. I'd like us to make this build specific to five-safes rocrates, so the naming should reflect this. Also we need to make sure to copy across a tagged release of our five-safes profile, so that we can in future say which exact version of the profile this will test against.

…file version is accessible through a label () or as an environment variable from inside the Docker image ().
@EttoreM EttoreM requested a review from douglowe March 12, 2026 08:27
@EttoreM EttoreM changed the title Added dockerfile and workflow to build Docker image with baked-in profiles Added dockerfile and workflow to build Docker image with baked-in five-safes profile Mar 12, 2026
Copy link
Collaborator

@douglowe douglowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a note regarding changing the location that the profile is extracted to.

On a broader compatibility note, I've tested building this container, and found that the five safes rocrate profile isn't compatible with the rocrate validator version in this container.

When I try to list the profiles I get the following error:

β”‚ /usr/local/lib/python3.11/site-packages/rocrate_validator/profiles/five-safes-crate/must/15_meta β”‚
β”‚ data_file.py:17 in <module>                                                                      β”‚
β”‚                                                                                                  β”‚
β”‚   14                                                                                             β”‚
β”‚   15 import re                                                                                   β”‚
β”‚   16                                                                                             β”‚
β”‚ ❱ 17 import rocrate_validator.log as logging                                                     β”‚
β”‚   18 from rocrate_validator.models import Severity, ValidationContext                            β”‚
β”‚   19 from rocrate_validator.requirements.python import PyFunctionCheck, check, requirement       β”‚
β”‚   20                                                                                             β”‚
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'rocrate_validator.log'

Do we need to import rocrate_validator.log in this file? Is this an error that has already been fixed? If so we should make a new release which includes the fix.

mkdir -p /app/profiles
wget -O /tmp/rocrate-validator-profiles.tar.gz "$PROFILES_ARCHIVE_URL"
tar -xzf /tmp/rocrate-validator-profiles.tar.gz \
-C /app/profiles \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to put the profiles data into the default directory, otherwise they will not be found by the validator. In this case it is: /usr/local/lib/python3.11/site-packages/rocrate_validator/profiles/

I don't like the bare python version in this string, so I would add this line at the top of the build script:

ARG PY_VER=3.11

And then:

    -C /usr/local/lib/python${PY_VER}/site-packages/rocrate_validator/profiles/ \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add release-triggered GitHub Actions workflow to build Docker image with baked-in profiles

2 participants