Skip to content

Add reusable Docker build and tag workflows#54

Closed
cellofellow wants to merge 1 commit intoveracode:masterfrom
cellofellow:use-ghcr-to-host-action-image
Closed

Add reusable Docker build and tag workflows#54
cellofellow wants to merge 1 commit intoveracode:masterfrom
cellofellow:use-ghcr-to-host-action-image

Conversation

@cellofellow
Copy link
Copy Markdown

In my organization we've been using self-hosted GitHub Actions runners that unfortunately are constantly hitting rate limits pulling from Docker Hub. Because this action does a docker build at the initiation of the action, which necessarily pulls from Docker Hub, it's been giving us troubles.

This change switches things up a little bit by making it no longer use the Dockerfile at action run time, so it doesn't have to pull the base image from Docker Hub at that point, and because it's instead pulling the image from GHCR it won't affect our Docker Hub pull rate limits.

Note that in our pipelines we're usually able to use credentials to pull from Docker Hub but there's no mechanism to pass credentials to the init stage of this action and so I'm proposing this solution.

Introduce a reusable docker build workflow and a tag-triggered workflow that
enforces the action.yml image tag matches the pushed git tag before building.
Add a docker build job to main workflow for consistent image publication and
enable buildx caching for faster iterative builds. Pin the action runtime to
a specific GHCR image version (0.2.10) for reproducibility and improved supply
chain security versus building ad hoc from the Dockerfile. Minor formatting
cleanup in main workflow.

Signed-off-by: Josh Gardner <joshua.gardner@wgu.edu>
@cellofellow
Copy link
Copy Markdown
Author

Hey, cool, your switch to JS instead of Dockerfile solves my issue I think.

@cellofellow cellofellow closed this Nov 7, 2025
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.

1 participant