Technical work, should be praised and then see, form a habitCopy the code

Docker use tutorial related series of directories

I found several Docker open source image repositories for the technical manager. Why did the manager choose Sonatype Nexus?


1. Log in to the system background

Open your browser and visit http://:8081/

Enter your account password

2. Create docker repository

Step 1: Create a repository

 

Step 2: Configure the warehouse

Setting the warehouse name

Specify a unique name for the repository, and then select HTTP or HTTPS. This is only for testing, so go HTTP

Note: Make sure the port is right.

You can view it in the warehouse list

Step 2: Configure the client

Because you are using HTTP, you need to edit the Docker configuration file on the client side, for example

vim /etc/systemd/system/multi-user.target.wants/docker.service
Copy the code

 

Find the ExecStart property and add –insecure-registry server IP:Docker repository port after dockerd

ExecStart=/usr/bin/dockerd --insecure-registry=ip:9021
Copy the code

Save, reload the configuration, and restart the Docker service

systemctl daemon-reload
Copy the code

systemctl restart docker
Copy the code

Three, the use of the client

Docker login IP :9021, enter the authorized account and password, prompt success then docker push image to the warehouse.

For example,

Docker login -u admin -p Your admin password 192.168.88.131:9021Copy the code

An error occurred on the client. Procedure

An error will be reported

The Error response from the daemon: Get http://192.168.88.131:9021/v1/users/: dial TCP 192.168.88.131:9021: connect: connection refusedCopy the code

The solution

1. Is the docker configuration file configured

If no, perform Step 2: Configure the warehouse

2. Have the ports of docker warehouse been mapped

Map port 9021

docker run -p 8081:8081 -p 9021:9021 --privileged=true --name nexus -v /usr/local/docker/nexus/nexus-data:/nexus-data 8716903d1912
Copy the code

Push image to private server

# tag mirror Docker tag Docker tag Centos_tomcat8 :v1 docker tag Centos_tomcat8 :v1 192.168.88.131:9021 / centos_tomcat8: v1Copy the code

When pushing, you need to use the Docker push private library address/image name: image tag

Then push the mirror to warehouse: docker push 192.168.88.131:9021 / centos_tomcat8: v1Copy the code

Pull an image from the private server

Docker pull 192.168.88.131:9021 / centos_tomcat8: v1Copy the code

At this point, you have installed the Nexus successfully and can pull and push on the client.

Thanks to:

When sorting out these two blog posts, I encountered some problems, thanks for the support of warm-hearted Yang colleagues and netizens, and felt the loveliness of technical people! Thank you!