-
Notifications
You must be signed in to change notification settings - Fork 531
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
Add support for --platform
flag in docker-build
task
#3874
Conversation
@@ -52,6 +52,7 @@ | |||
"vscode-docker.tasks.docker-build.dockerBuild.dockerfile": "Path to the Dockerfile used for the build.", | |||
"vscode-docker.tasks.docker-build.dockerBuild.labels.description": "Labels applied to the Docker image used for debugging.", | |||
"vscode-docker.tasks.docker-build.dockerBuild.labels.includeDefaults": "Whether to include the default set of labels defined by the Docker extension", | |||
"vscode-docker.tasks.docker-build.dockerBuild.platform": "Target platform for the image build", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this option support just single platform, or is multi-platform build possible? Perhaps it is worth to clarify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I originally thought to do multiple since that's what I saw in examples, but upon closer inspection, that applies only to the docker buildx build
command--not the regular docker build
command, which only accepts a single platform option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, in tasks.json it will give a warning squiggle if you try to give an array instead of a single value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right @bwateratmsft. It is one step even more nuanced than that.
Behavior of buildx
:
- Doesn't publish images to the image cache, by default.
- Only supports publishing images to the cache when a single platform is set.
AFAICT, the multi-platform option (which is awesome!) is intended for direct push to registry. That's what I've used it for. As a side-note, when used correctly, you end up with --pull --push
together. I find that to be pretty funny each time I see it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. That's the one.
Closes #3870.