Score:0

buildx is not a docker command

cn flag

I've got Docker 20.10.21 installed on Ubuntu 23.04. I've also run

export DOCKER_CLI_EXPERIMENTAL=enabled

However, when I run docker buildx, I get

docker: 'buildx' is not a docker command.
See 'docker --help'

I was under the impression that, on Debian-flavored OSes, buildx comes installed with the docker.io package. How do I get this working?

docker version shows

Client:
 Version:           20.10.21
 API version:       1.41
 Go version:        go1.20.1
 Git commit:        20.10.21-0ubuntu3
 Built:             Tue Feb 28 14:28:22 2023
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.21
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.20.1
  Git commit:       20.10.21-0ubuntu3
  Built:            Tue Feb 28 12:17:52 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.12-0ubuntu3
  GitCommit:        
 runc:
  Version:          1.1.4-0ubuntu3
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:
ru flag
@DanielW.how did you install Docker to begin with? From their repos or from snaps? Or, did you install directly from the Ubuntu repos (which have very outdated versions of Docker) The answer to this will be important.
Daniel W. avatar
cn flag
I ran `apt -y install docker.io`.
ru flag
that is an ancient version of docker, and because you don't have the Docker repositories set up on your system you **will not** have a recent version of Docker and other plugin libraries. Follow the instructions at https://docs.docker.com/engine/install/ubuntu/ for setting up *their* repos for you to get the properly up to date version of Docker and its plugins, then the answers provided by the other users will work.
Score:2
sz flag

Make sure you follow the steps described here https://docs.docker.com/engine/install/ and you should be able to install the docker-buildx-plugin

    $ apt-cache policy docker-buildx-plugin
docker-buildx-plugin:
  Installed: 0.10.4-1~ubuntu.20.04~focal
  Candidate: 0.10.4-1~ubuntu.20.04~focal
  Version table:
 *** 0.10.4-1~ubuntu.20.04~focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
        100 /var/lib/dpkg/status
     0.10.2-1~ubuntu.20.04~focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
Score:1
in flag

The docker-buildx-plugin package is generally not installed by default. That said, let's check to make sure it's there and, if it's not, get it installed. Here's how:

  1. Open Terminal (if it's not already open)
  2. Check to see if the plugin is installed:
    sudo apt list --installed | grep buildx
    
    If the above command returns nothing, then we've confirmed that the docker-buildx-plugin package is not installed. Continue to the next step.
  3. Install the missing package:
    sudo apt install docker-buildx-plugin
    
  4. Try your docker buildx command again

One thing that I've seen is that an upgrade from one version of Ubuntu to another can also result in this plugin disappearing from Docker's view. Reinstalling just this plugin alone resolves the matter.

Daniel W. avatar
cn flag
`apt` doesn't see any package named `docker-buildx-plugin`. `apt search buildx` also shows nothing.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.