Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

unknown flag: --platform linux/amd64 #183

Open
sauberdev opened this issue Dec 3, 2024 Discussed in #182 · 0 comments
Open

unknown flag: --platform linux/amd64 #183

sauberdev opened this issue Dec 3, 2024 Discussed in #182 · 0 comments

Comments

@sauberdev
Copy link

Discussed in https://github.com/orgs/devcontainers/discussions/182

Originally posted by sauberdev December 3, 2024
Hello all,

I'm trying to use dev containers extension in VS code and I have encountered an issue and not sure how to resolve that. I'm using MacBook M4 for development and I need to build a C++ project in a docker container. However, because some tools I use are not available for ARM platform, I have to build AMD64 container.

I'm able to build it manually and it works fine. However, when I try to build it using .devcontainer.json, I get an error that platform flag is unknown.

Here is a config what I'm using:

{
	"name": "Ubuntu",
	"initializeCommand": "export DOCKER_DEFAULT_PLATFORM=linux/amd64",
	"build": {
    	"dockerfile": "Dockerfile",
		"options": ["--platform linux/amd64"]
  	},
	"extensions": [
		"ms-vscode.cmake-tools",
		"ms-vscode.cpptools-extension-pack",
		"ms-vscode.cpptools"
	],
}

When I trigger rebuild command, I get the following:

 Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/tc/cm00y_n96yn3q619t2cvtdrc0000gn/T/devcontainercli/container-features/0.71.0-1733226663215/Dockerfile-with-features -t vsc-test-f97d6391aa323a25664fe9ca89456bc9934932ebb4af40644b657e242211331b --target dev_containers_target_stage --platform linux/amd64 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /Users/test/Documents/test/.devcontainer
[2024-12-03T11:51:03.266Z] unknown flag: --platform linux/amd64
See 'docker buildx build --help'.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant