After reading a lot of documentation and searching on the internet, I can’t find where come from this issue.
When i want to buid a image with a right clic and “Build image” this error showing “ERROR: “docker buildx build” requires exactly 1 argument. with VS code”.
The command VS execute Executing task: docker build --pull --rm -f “Dockerfile\Exemple 1\Dockerfile” -t test_test:latest “Dockerfile\Exemple 1”
When I try to build my image from terminal "image build -t test:lastest ."
It’s work fine.
I’m new in the Docker univers and I think is just something i’m missing but i can’t find what
If anyone can help me a bit, thank you !
You say vscode executes a docker build command without buildx but compains about buildx build requiring exactly one argument. Are you sure you shared the exact commands? And what is
image build -t test:lastest
?
Although usually it is not recomended, this is the time of copy-pasting and sharing the exact commands you ran or explaining a command if that is not standard docker command.
The command “image build -t test:lastest” is the command i run to build my image with the terminal (without VS code) and i’m in the folder where the Dockerfile is.
And here the full error from the terminal when I do a right clic on the dockerfile and try “Build image”
Please, use </> button to share codes, terminal outputs, error messages instead of sharing screenshots. That helps others to search for similar issues and us to read it more easily and quote parts of the message so we can help you more quickly. You can find a complete guide in the following post: How to format your forum posts
I can’t quote, but ther eis a possible issue their which is the space in the folder name. It seems vs code wants to run a command through powershell so it passes the command as an argument. It may be perfectly okay, but this is my only guess so far.
I removed the quotation marks around the last argument and got the same error message mentioning buildx. The default docker build command uses buildx behind the scenes, but I didn’t expect it to be in an error message. Based on this I think what I wrote in my previous message
You just have the exact same problem that @cocosete29 described. Notice the dot character at the end of the second command. That’s the build context. The same as using $(pwd)