Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate building Docker container images #570

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jhollowe
Copy link

This PR Adds a Dockerfile to the application to allow for easier building of containers. The existing deploy script does most of the setup on the host rather than within the container. This forces the host to have the required tools and files rather than having these requirements solely within the container. This also meant that the container had to be the same architecture (x86, x86_64, arm, etc) as the building host.
The added Dockerfile also contains two build stages, one which installs the minimal dependencies for pts to run ("light" version) and one which installs packages required by most tests ("full" version). The default when doing a docker build is the full version, but adding --target light will produce the minimal light build. The full version strictly builds off of the light version, so pulling the full version also pulls the light version, and pulling the light version pulls a significant portion of the full version.

This PR additionally adds a GitHub Actions workflow to automatically build and push the containers. It activates on any pushes to the master branch as well as any pushed version tags (tags matching "v*"). The master branch builds will be tagged as "edge" and "edge-light". Builds of version tags will be tagged with major, major and minor, and major and minor and patch (e.g. a tag of "v1.2.3" will create a build with tags of "1", "1.2", and "1.2.3") as well as the "latest" tag. An additional image will be created for the light version with the same tags as the full version but with "-light" appended (e.g. "1-light", "1.2-light", "1.2.3-light", and "latest-light").
These builds are completed for multiple architectures (currently amd64, arm/v7, arm64, and riscv64) with the different versions of the same code combined together within the manifest. This allows a user on any platform to pull the tag "1.2.3" and will select the correct image for their architecture.

This PR currently pushes containers to the GitHub Container Registry (ghcr.io). This simplifies authenticating with the registry (automatic rather than requiring setup like Docker Hub) and uses the repo name as the container name ("ghcr.io/phoronix-test-suite/phoronix-test-suite"). However, this name can easily be changed and another container registry used or added.

TL;DR - adds Dockerfile and auto (multi-architecture) builds using GH Actions, pushing to GHCR using the same name as the repo.

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.

None yet

1 participant