Hello, friends. Many newbies want to start with Docker, but it turns out that due to inexperience they do not manage to do the right process and have some errors when using it. Today, you will learn how to fix the error “buildx is not a docker command”. Let’s go.
According to the GitHub profile of the tool.
buildx is a Docker CLI plugin for extended build capabilities with BuildKit.
In short, this tool extends the
build functionality to help you create Docker images faster and more efficiently.
Some key features of this tool are:
- Familiar UI from docker build
- Full BuildKit capabilities with container driver
- Multiple builder instance support
- Multi-node builds for cross-platform images
So, it can be very useful where you specifically need to create images for different architectures.
How to fix the error “buildx is not a docker command”.
This error happens when you invoke it incorrectly, or it is not present in the system.
So, the first thing you have to do is to install Docker by following this guide.
How to install Docker on Ubuntu 22.04?
This guide will not only give you the latest version of Docker but are also instructions based on the official documentation, so you will have support that they are correct.
docker: 'buildx' is not a docker command. See 'docker --help'
The source of the error is that many believe that when installing Docker from official or external repositories the installation includes
buildx but it does not. So, after you have docker ready, you can run
sudo apt install docker-buildx-plugin
This way, you will no longer get the above error.
You will see this:
Buildx is an interesting way to build Docker images in a better way. This error is normal for a newbie and every learner, however, sometimes it is annoying and good to know.
I’m afraid that this guideline would not work against Ubuntu standard repos. There is no docker-buildx-plugin.
One should add https://download.docker.com/linux/ubuntu