Push the manifest list to an insecure registry
In this step, we will explore how to push a manifest list to an insecure registry. An insecure registry is a registry that does not use TLS/SSL certificates, which is not recommended for production environments but can be useful for testing or internal networks.
By default, Docker requires secure connections to registries. To push to an insecure registry, you need to configure the Docker daemon to allow insecure connections to that specific registry address.
For this lab, we will simulate an insecure registry by using a local registry running without TLS. First, let's run a local registry container. We will map port 5000 on the host to port 5000 on the container.
docker run -d -p 5000:5000 --name registry registry:2
You should see output similar to this, indicating the container is running:
Unable to find image 'registry:2' locally
2: Pulling from library/registry
...
Status: Downloaded newer image for registry:2
a1b2c3d4e5f6...
Now, we need to configure the Docker daemon to trust this insecure registry at localhost:5000
. This requires modifying the Docker daemon configuration file. The location of this file can vary, but on most Linux systems, it's /etc/docker/daemon.json
.
We will use sudo nano
to edit this file.
sudo nano /etc/docker/daemon.json
If the file doesn't exist, you can create it. Add or modify the insecure-registries
key to include localhost:5000
. The file content should look like this:
{
"insecure-registries": ["localhost:5000"]
}
Save the file and exit the editor (Ctrl+X, Y, Enter in nano).
After modifying the configuration, you need to restart the Docker daemon for the changes to take effect.
sudo systemctl restart docker
Now, you can tag the manifest list with the insecure registry address and push it. We will use the manifest list my-alpine:latest
created in the first step.
docker manifest create localhost:5000/my-alpine:latest alpine:latest arm64v8/alpine:latest
docker manifest push localhost:5000/my-alpine:latest
You should see output indicating the push is successful, even though the registry is insecure.
Pushed manifest list localhost:5000/my-alpine:latest
This demonstrates how to push a manifest list to an insecure registry after configuring the Docker daemon.