DOCKER HARBOR

Harbor is Docker private library. An open source platform such as Harbor by VMWare that built in the Go language. It can be used to save the private picture of the squad. Now, in this tutorial we will try 2 Virtual Machine, the first virtual machine will use for Archive docker images into a compressed file, and transfer the compressed file to the second virtual machines and start,

VIRTUAL MACHINE 1

On the virtual machine 1, you can build your own warehouse Harbor by download the harbor compressed file, follow the command below:

  • wget http://csie.nqu.edu.tw/smallko/harbor1.9.0.tgz

    ls

    tar xvfz harbor1.9.0.tgz

    gedit harbor.yml &

  • Change the Hostname to your ip address

  • sh install.sh

  • # wget means download the package like zip or tar from the website
    # ls means see the list of the current directory
    # tar means seems like unzip the file
    # sh means execute the code of the .sh

    After the compilation is complete, you can type the local IP on the website, and the following screen will show like the picture below:

    VIRTUAL MACHINE 2

    Before Virtual Machine 2 can use Docker Harbor Images, make sure that VM2 can connect to internet and your docker hub account also active. Then we will try to push Docker Busybox images to Harbor library, First you have to pull busybox first on the VM2,

      Before Virtual Machine 2 can use Docker Harbor Images, make sure that VM2 can connect to internet and your docker hub account also active. Then we will try to push Docker Busybox images

    • docker pull busybox

    • Now, we try to push docker busybox images

    • docker tag dc3 172.16.98.154/library/busybox:latest

      docker push 172.16.98.154/library/busybox:latest

    • Now, we try to login by Harbor IP

    • docker login 172.16.98.154

    • If you see that the daemon is rejected or the connection refused, so this is the command to solve it, edit the daemon.json

    • gedit /etc/docker/daemon.json

    • {
      "insecure-registries": Harbor ip
      }

    • After you follow the instruction, restart daemon-reload and docker

    • systemctl daemon-reload

      systemctl restart docker

    • To test whether the private storage is successful, you can docker push an image file, by following command,

    • docker push library 172.16.98.154/library/busybox:latest

    • After you push to the Harbor Library, you can see whether it success or no, see the picture below,

      Private storage (harbor) test

      To test for success, you can go back to VM1 and use:

    • docker login harbor ip

    • After successful login, you can pull at VM1