- Start the registry server
docker run -d -p 5000:5000 --restart=always --name registry registry:2
- Make the registry can be accessed by others
Be default if you don’t do the following step, you can only access the registry from “localhost:5000”.
There are several ways to do this in the offical document, here is the simplest. You need to do the
following steps in every client machine who wants to connect to this registry server.
# 1. Edit the client side "/etc/default/docker" file, and add the following
- Use the registry
# 0. You need to have a local build image.
- Set the storage backend
By default, your registry stores its data on the local filesystem, inside the container.
You can set a directory to storge the registry data by running the following command to start the registry:
docker run -d -p 5000:5000 \
- Use Compose to start registry server
Create a “docker-compose.yml” file with the following content in it:
Run “docker-compose up -d” to start the registry server.
- First you need to know how to push and pull images to/from the registry.
# 1. Build the local Docker file.
- Then you can create a Docker Compose file to leverage the registry:
- After that you can start the compose file very easily:
# Note the "--allow-insecure-ssl" argument without with docker-compose