Create a new builder instance
In this step, we will learn how to create a new builder instance in Docker. A builder instance is a backend for building Docker images. By default, Docker uses a single builder instance, but you can create new instances with different configurations, such as using a different build driver or connecting to a remote builder.
To create a new builder instance, we use the docker buildx create
command. This command allows us to specify various options for the new instance, such as the name, driver, and endpoint.
Let's create a new builder instance named mybuilder
. We will use the default docker
driver, which uses the Docker daemon to build images.
docker buildx create --name mybuilder
After running this command, Docker will create a new builder instance with the specified name. You should see output similar to this:
mybuilder
This output confirms that the mybuilder
instance has been created.
Now, let's verify that the new builder instance has been created successfully. We can use the docker buildx ls
command to list all available builder instances.
docker buildx ls
The output of this command will show a list of builder instances, including the default one and the new mybuilder
instance we just created. Look for the mybuilder
entry in the list.
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT
default docker
default default running v0.10.5
mybuilder docker
mybuilder default running v0.10.5
In the output, you can see that mybuilder
is listed with the docker
driver and a status of running
. This indicates that the new builder instance is ready to be used.