Private Docker Hub-Harbor
2 min readJun 1, 2021
Harbor is an open source software developed by VMWare in GO language,used to store the team’s private image,Harbor provides a simple UI interface,includes authority control,and cross-machine auto-synchronization,and easy to install.
Official : Harbor
Reference : Learning_note
Architecture
Access Privileges
- Guest: allow only pull images
- Developer: allow pull / push images
- Admin: manage all permissions for the group
Installation
1. Download Harbor offline version
wget https://github.com/goharbor/harbor/releases/download/v2.2.2/harbor-offline-installer-v2.2.2.tgz
2. Decompress file
tar xvf harbor-offline-installer-v2.2.2.tgz
3. Install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose# give executable permissions
sudo chmod +x /usr/local/bin/docker-compose
4. Exec install.sh
mv harbor.yml.tmpl harbor.yml
sudo ./install.sh
5. Modify /etc/docker/daemon.json
nano /etc/docker/daemon.json
# add "insecure-registries": ["harbor.domain"]
6. Restart docker service
sudo systemctl daemon-reload && sudo systemctl restart docker
Connect Harbor
- open Harbor web (Account:root ; Password : Harbor12345)
- Create User
3. Apply user to registry
Push images to Harbor
sudo docker pull hello-world
sudo docker login test
sudo docker tag hello-world harbor.domain/library/hello-world:0.1
sudo docker push harbor.domain/library/hello-world:0.1