Docker use tutorial related series catalog
table of Contents
1. Log in to the system background
Second, create a docker warehouse
Step 2: Configure the warehouse
Step two: client configuration
pull Pull the mirror from the private server
1. Log in to the system background
Open the browser and visit http://:8081/
Enter account password
Second, create a docker warehouse
Step 1: Create a warehouse
Step 2: Configure the warehouse
Set the warehouse name
Specify a unique name for the warehouse, and then choose http or https. This is just for testing, so go http
Note: The port must be determined.
After the creation is successful, you can view it in the warehouse list
Step two: client configuration
Because http is used, you need to edit the docker configuration file on the client side, such as
vim /etc/systemd/system/multi-user.target.wants/docker.service
Find the ExecStart property and add --insecure-registry server IP:Docker warehouse port after dockerd
ExecStart=/usr/bin/dockerd --insecure-registry=ip:9021
Save, reload the configuration and restart the docker service
systemctl daemon-reload
systemctl restart docker
Three, client use
First docker login ip: 9021, enter the authorized account and password, and after the prompt is successful, you can docker push the image to the warehouse.
E.g
docker login -u admin -p 你的admin密码 192.168.88.131:9021
Client use error
An error will be reported at this time
Error response from daemon: Get http://192.168.88.131:9021/v1/users/: dial tcp 192.168.88.131:9021: connect: connection refused
solution
1. Is there any configuration in the docker configuration file?
If there is no configuration, please follow the operation step two: configure the warehouse
2. Is the port of the docker warehouse mapped?
Map out port 9021
docker run -p 8081:8081 -p 9021:9021 --privileged=true --name nexus -v /usr/local/docker/nexus/nexus-data:/nexus-data 8716903d1912
push mirror to private server
#先tag镜像,把镜像名变成包含本地仓库名(如192.168.88.131:9021)的镜像
#docker tag 本地镜像名:镜像tag 私有库地址/镜像名:镜像tag
docker tag centos_tomcat8:v1 192.168.88.131:9021/centos_tomcat8:v1
When pushing, you need to use docker push Private library address/mirror name: mirror tag
再push镜像至仓库中:
docker push 192.168.88.131:9021/centos_tomcat8:v1
pull Pull the mirror from the private server
docker pull 192.168.88.131:9021/centos_tomcat8:v1
At this point, it means that nexus has been installed successfully, and you can pull and push on the client.
thank:
I encountered some problems when sorting out these two blog posts. Thanks to my enthusiastic colleague Yang and netizens for their support, and I feel the love of the technical people! Thank you very much!