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

docker: 'buildx' is not a docker command #3532

Open
jack-liew opened this issue Dec 3, 2022 · 7 comments
Open

docker: 'buildx' is not a docker command #3532

jack-liew opened this issue Dec 3, 2022 · 7 comments
Assignees
Labels
area/vs-code kind/bug Something isn't working
Projects

Comments

@jack-liew
Copy link

jack-liew commented Dec 3, 2022

Actual Behavior

Hi:
The Container Engine of my rancher desktop is configured to docker, and when I followed the steps of VS Code Remote Containers in how-to-guides, an error message appeared. [docker: 'buildx' is not a docker command]

Thanks

Steps to Reproduce

[https://docs.rancherdesktop.io/how-to-guides/vs-code-remote-containers/]

6.Click on the button at the lower left corner of the window and select Open Folder in Container... from the command palette. Browse to one of the samples in the cloned respository, e.g., javascript-node.

Result

[813 ms] (Use `Code --trace-deprecation ...` to show where the warning was created)
[815 ms] @devcontainers/cli 0.23.2. Node.js v16.14.2. win32 10.0.22621 x64.
[815 ms] Start: Run: docker buildx version
[907 ms] 
[907 ms] docker: 'buildx' is not a docker command.
See 'docker --help'

[907 ms] Exit code 1

Expected Behavior

How to fix it?

Additional Information

No response

Rancher Desktop Version

1.62

Rancher Desktop K8s Version

1.25.4

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

windows 11

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

No response

@jack-liew jack-liew added the kind/bug Something isn't working label Dec 3, 2022
@github-actions github-actions bot added this to To do in Stripey via automation Dec 3, 2022
@gunamata
Copy link
Contributor

@jack-liew, I could not reproduce this issue on my machine. I m on a Win 10 machine and I tried it with the current release (1.6.2) of Rancher Desktop.

Can you please try again? if you run into the issue, Can you please share the full dev container log ?
You can view the log with (F1 > Remote-Containers: Show Container Log)

@gunamata
Copy link
Contributor

@jack-liew , Do you still face this problem? Do you mind trying this on our latest release 1.7.0 and share the logs here if you still see the issue.

@walkure
Copy link

walkure commented Jan 17, 2023

I met same issue on latest Rancher Desktop(v1.7.0) with Windows 10.

And I found that docker-buildx.exe doesn't exist on %USERPROFILE%\.docker\cli-plugins ( only docker-compose.exe has been exists on my environment). This path is inspired from https://github.com/docker/buildx#manual-download.

So, I copied docker-buildx.exe from C:\Program Files\Rancher Desktop\resources\resources\win32\bin to %USERPROFILE%\.docker\cli-plugins and successfully my devcontainer has been built and started.

I hope you find this useful.

@gunamata
Copy link
Contributor

@walkure , Rancher Desktop should have made the docker-buildx.exe available at C:\Program Files\Rancher Desktop\resources\resources\win32\bin\ as part of the installation. Do you see docker-buildx.exe at C:\Program Files\Rancher Desktop\resources\resources\win32\bin\ on your machine?

@gunamata
Copy link
Contributor

My bad, i was too quick to repond to your message. It looks like you have the file at C:\Program Files\Rancher Desktop\resources\resources\win32\bin\

@walkure
Copy link

walkure commented Jan 17, 2023

I found that I cannot execute docker buildx at WSL2 😢 .
It seems the same issue above.

walkure@nozomi:~$ docker --help

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default "/home/walkure/.docker")
(snip)
  wait        Block until one or more containers stop, then print their exit codes

Invalid Plugins:
  buildx      failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-buildx: no such file or directory
  dev         failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-dev: no such file or directory
  extension   failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-extension: no such file or directory
  sbom        failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-sbom: no such file or directory
  scan        failed to fetch metadata: fork/exec /usr/local/lib/docker/cli-plugins/docker-scan: no such file or directory

Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at https://docs.docker.com/go/guides/
walkure@nozomi:~$ docker --version
Docker version 20.10.21-rd, build ac29474
walkure@nozomi:~$
walkure@nozomi:~$ ls -l .docker/cli-plugins/
total 4
lrwxrwxrwx 1 walkure walkure 81 Jan 15 15:05 docker-compose -> '/mnt/c/Program Files/Rancher Desktop/resources/resources/linux/bin/docker-compose'
walkure@nozomi:~$

@jlbfenergo
Copy link

jlbfenergo commented Jan 27, 2023

I managed to fix the issue on my Linux WSL distro after adding a symlink to docker-buildx on .docker/cli-plugins/ and also correcting the symlink for docker-compose. Both symlinks are pointing to the Rancher Desktop installation folder.

image

image

For Windows, I did the same as @walkure.

I met same issue on latest Rancher Desktop(v1.7.0) with Windows 10.

And I found that docker-buildx.exe doesn't exist on %USERPROFILE%\.docker\cli-plugins ( only docker-compose.exe has been exists on my environment). This path is inspired from https://github.com/docker/buildx#manual-download.

So, I copied docker-buildx.exe from C:\Program Files\Rancher Desktop\resources\resources\win32\bin to %USERPROFILE%\.docker\cli-plugins and successfully my devcontainer has been built and started.

I hope you find this useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vs-code kind/bug Something isn't working
Projects
No open projects
Stripey
To do
Development

No branches or pull requests

5 participants