[Ubuntu] docker deployment harbor

In order for Docker to communicate with Harbor and push/pull images, you need to add Harbor information to the Docker configuration. Specifically, you need to specify the address of Harbor in the configuration file of the Docker daemon, and restart the Docker service for the configuration to take effect.

Here are the steps to configure Docker integration with Harbor:

  1. Open the Docker configuration file: Open the Docker configuration file with a text editor daemon.json. This file is usually located at /etc/docker/daemon.json.

    sudo vim /etc/docker/daemon.json

    If the file does not exist, a new one can be created.

  2. Add the address of Harbor: Add the following content in the configuration file to specify the address of Harbor, and replace harbor.example.comwith your Harbor hostname or IP address.

    { "insecure-registries": ["harbor.example.com"] }

    If your Harbor uses HTTPS, you need to harbor.example.comreplace with Harbor's HTTPS address, and make sure the certificate is properly configured.

    If "insecure-registries"the key already exists in the configuration file, just add Harbor's address to the existing array.

  3. Save and Close File: Saves daemon.jsonchanges to the file and closes the editor.

  4. Restart the Docker service: Run the following command to restart the Docker service for the configuration to take effect.

    sudo systemctl restart docker

Now, Docker will be able to connect to Harbor and can push and pull images.

Please make sure Harbor is properly configured and you can access and log in to the Harbor repository before following the steps above.

Hope this helps you configure Docker integration with Harbor! If you have any other questions, please feel free to ask.

Guess you like

Origin blog.csdn.net/Holenxr/article/details/131745991
Recommended