Remove aliases created by buildx when installing by default#139
Merged
crazy-max merged 2 commits intodocker:masterfrom May 21, 2025
Merged
Remove aliases created by buildx when installing by default#139crazy-max merged 2 commits intodocker:masterfrom
crazy-max merged 2 commits intodocker:masterfrom
Conversation
3c6e8ed to
fdd372a
Compare
Contributor
Author
|
Thanks for approving the CI run @tonistiigi. Looks green (kind of expected since no tests exist for the cleanup part and I couldn't figure out how to add one). Let me know if there's something more you'd like me to do. |
crazy-max
requested changes
Jun 6, 2023
Member
crazy-max
left a comment
There was a problem hiding this comment.
Sorry for the delay! Needs a rebase and adapt following changes that have been made recently, thanks!
src/main.ts
Outdated
Comment on lines
130
to
143
| if (stateHelper.IsBuildxDefaultBuilder) { | ||
| core.startGroup('Uninstalling build aliased to buildx'); | ||
| await exec | ||
| .getExecOutput('docker', ['buildx', 'uninstall'], { | ||
| ignoreReturnCode: true | ||
| }) | ||
| .then(res => { | ||
| if (res.stderr.length > 0 && res.exitCode != 0) { | ||
| core.warning(res.stderr.trim()); | ||
| } | ||
| }); | ||
| core.endGroup(); | ||
| } | ||
| } |
Member
fdd372a to
640bfe6
Compare
Contributor
Author
|
I've addressed the comments. PTAL @crazy-max. I eventually came back to this while cleaning up my open PRs. |
If the action is configured to install buildx by default using the input then docker buildx sets up docker build as an alias for buildx making all docker build calls use the buildx builder instead of traditional builders. The action didn't perform cleanup in this case to uninstall the aliases which meant that any future workflows running on same GitHub Actions runner would get the buildx builders even if it did not explicitly request it. This commit tracks if the aliases were installed and removes them during post step of the action if so. Signed-off-by: Ashhar Hasan <[email protected]>
Signed-off-by: CrazyMax <[email protected]>
640bfe6 to
f3204bb
Compare
crazy-max
approved these changes
May 21, 2025
Member
crazy-max
left a comment
There was a problem hiding this comment.
LGTM thanks!
Pushed extra commit to update generated content.
1 task
This was referenced Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the action is configured to install buildx by default using the
input then docker buildx sets up docker build as an alias for buildx
making all docker build calls use the buildx builder instead of
traditional builders. The action didn't perform cleanup in this case to
uninstall the aliases which meant that any future workflows running on
same GitHub Actions runner would get the buildx builders even if it did
not explicitly request it.
This commit tracks if the aliases were installed and removes them during
post step of the action if so.
Fixes #125