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

IT-3421: Build just before pushing image #5

Merged
merged 59 commits into from
Aug 19, 2024

Conversation

brucehoff
Copy link
Contributor

Previously the workflow (1) built the Docker image, (2) saved as a tar-blob, (3) scanned (using Trivy), (4) reload the tar-blob as an image and pushed the image to ghcr.io. However it turns out that when a tar-blob is reloaded, crucial metadata about the image is lost. One discussion on the topic is here.. The fix is to build the image just before pushing (with no save/load in between). Building the image twice makes the workflow less efficient but it works.

brucehoff added 26 commits July 25, 2024 06:37
@brucehoff brucehoff requested a review from a team August 16, 2024 23:57
Copy link
Member

@ConsoleCatzirl ConsoleCatzirl left a comment

Choose a reason for hiding this comment

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

same comment as Sage-Bionetworks-IT/notebook-reverse-proxy#10

I'm fine with building twice, but there are also docker save and docker load commands if you want to try them.

@brucehoff
Copy link
Contributor Author

same comment as Sage-Bionetworks-IT/notebook-reverse-proxy#10

I'm fine with building twice, but there are also docker save and docker load commands if you want to try them.

Thanks for this suggestion. While docker save / docker load will, indeed, solve the immediate problem of losing image metadata, the commands introduce a new problem: Since the GitHub workflow builds multiple tags, and since save and load are tag-specific, we'd have to create a matrix of parallel jobs to save/load each tag. It's far easier simply to build the image twice.

@brucehoff brucehoff merged commit 08afda8 into Sage-Bionetworks-IT:main Aug 19, 2024
5 checks passed
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.

2 participants