docker - create a harbor private warehouse

1.What is harbor

        Just like docker official, it has an official warehouse at hub.docker.com , which provides us with many practical image files, so that we can directly use docker pull to pull down the required image and run it. Similarly, we users can also create an image warehouse ourselves and push the image files we create into the private harbor warehouse. We can also pull them down and run them to facilitate our management and use . In fact, this is similar to Git, which facilitates image version control and backup.

2. Deploy a harbor warehouse in the cloud server

        1. Create a harbor file and pass in the harbor compressed package        

            

        2. Unzip the compressed package and enter the harbor directory that appears after decompression.

        3. Copy harbor.yml.tmpl to harbor.yml file and modify the harbor.yml file 

     

     

         4. Due to the update of the docker version, the docker-compose command is no longer supported , so you need to pass in a docker-compose file, pass in the first harbor directory, grant executable permissions, and then copy it to /usr/ under the bin/ directory

        5. Continue to enter the second harbor directory and run the installation script 

        Due to the last deployment of prometheus, an error occurred in the container conflict, so I first deleted the conflicting container.

         Next continue running the installation script

         6. Go to the browser to access the harbor warehouse. The listening port I changed is 8089.

 3. Configure and use harbor warehouse

        1. Log in to the harbor warehouse, default account name: admin, default password: Harbor12345

        2.  Click New Project inside, set the project name hb1, the level is public, and the capacity is 10G

         3. Create a new user, click User Management, create a user, and set it as an administrator

         4. Click on the hb1 project, view the push command, and copy the project mark command

docker tag SOURCE_IMAGE[:TAG] 192.168.83.232:8089/hb1/REPOSITORY[:TAG]

        5. Write a daemon.json file and set docker to start at boot

    

                    

        6.  Rerun the script

         7. Log in to the system administrator account you created and transfer the tagged image file to the private warehouse. This push command can also be viewed and copied on the web interface. You can modify it slightly, but you do not need to modify your project name. path

         8. Docker images Query existing image files, label and push one to your own warehouse. The two commands of pushing and labeling are copied from the hb1 project.

         9. Delete this image in the docker container and pull hello:1.0 from your own warehouse.

   

        The above is the introduction and simple use of harbor. 

Guess you like

Origin blog.csdn.net/m0_53891399/article/details/132376887