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

Use docker buildx to publish images #3127

Closed
wants to merge 1 commit into from

Conversation

andrewslotin
Copy link
Contributor

This PR addresses an issue with the current build process not pushing the latest built image caused by #3015. For example grafana/k6:master image built a few days ago is the same as grafana/k6:0.44.1 that has been pushed a month ago.

Screenshot 2023-06-16 at 11 19 39

The reason for this is that docker buildx uses a different context to build images, which means that all subsequent docker run and docker push commands work with an image that is different from what has been built at the “Build” step.

The reason why this went unnoticed is the “Check” step, that “fixes” default context state by pulling the latest grafana/k6 image from DockerHub and this is the image used by all subsequent stages.

Once this applied, build-docker job will start using docker buildx --push to publish the image from multibuilder context instead of default. Since we don't change any files in-between, this command always uses the cached image created during the "Build" step. To run smoke test at the "Check" stage, we're going to load it into the default context by executing docker buildx --load before running the image.

@github-actions github-actions bot requested review from codebien and imiric June 16, 2023 09:51
@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2023

Codecov Report

Merging #3127 (e40d295) into master (2e5631f) will decrease coverage by 0.02%.
The diff coverage is n/a.

❗ Current head e40d295 differs from pull request most recent head dd11c0d. Consider uploading reports for the commit dd11c0d to get more accurate results

@@            Coverage Diff             @@
##           master    #3127      +/-   ##
==========================================
- Coverage   73.86%   73.85%   -0.02%     
==========================================
  Files         243      243              
  Lines       18492    18492              
==========================================
- Hits        13659    13657       -2     
- Misses       3964     3966       +2     
  Partials      869      869              
Flag Coverage Δ
ubuntu 73.79% <ø> (+0.01%) ⬆️
windows 73.69% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

imiric pushed a commit that referenced this pull request Jun 16, 2023
This reverts commit 9fa50b2.

Pushing of ARM images is not working[1], and there are issues with
pushing master images[2].

Rather than deal with risky fixes with buildx days before the v0.45.0
release, we've decided to roll back this change and migrate to buildx
later, once we've understood and tested the build process better.

[1]: #3015 (comment)

[2]: #3127
imiric pushed a commit that referenced this pull request Jun 16, 2023
This reverts commit 9fa50b2.

Pushing of ARM images is not working[1], and there are issues with
pushing master images[2].

Rather than deal with risky fixes with buildx days before the v0.45.0
release, we've decided to roll back this change and migrate to buildx
later, once we've understood and tested the build process better.

[1]: #3015 (comment)

[2]: #3127
@andrewslotin
Copy link
Contributor Author

Closing as not necessary, since #3015 has been reverted.

@andrewslotin andrewslotin deleted the use_buildx_to_publish_images branch June 16, 2023 12:25
@andrewslotin andrewslotin restored the use_buildx_to_publish_images branch August 29, 2023 10:25
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