Install Harbor in Ubuntu
Вставка
- Опубліковано 8 вер 2024
- Harbor is an open source trusted cloud native registry project that stores, signs, and scans content. Harbor extends the open source Docker Distribution by adding the functionalities usually required by users such as security, identity and management.
Here are the steps outline in my video. I have also added step to debug and ensure that the installation goes successfully.
A) Prerequisites installation
sudo su
apt update && sudo apt -y full-upgrade
apt install apt-transport-https ca-certificates curl software-properties-common
B) Install Docker
curl -fsSL download.docke... | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] download.docke... $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt upgrade -y
apt-cache policy docker-ce
apt install docker-ce -y
systemctl status docker
OPTIONAL: If docker is not started
sudo systemctl start docker && sudo systemctl enable docker
Add your system use to the Docker Group.
usermod -aG docker $USER
newgrp docker
Check if a reboot is required after system upgrade.
[ -f /var/run/reboot-required ] && sudo reboot -f
Check versions
docker version
docker compose version
OPTIONAL: If docker-compse is not avaiable
curl -s api.github.com...|grep browser_download_url|grep docker-compose-linux-x86_64 | cut -d '"' -f 4|wget -qi -
chmod +x docker-compose-linux-x86_64
sudo mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
rm docker-compose-linux-x86_64.sha256
Make sure docker-compose still works
docker compose version
C) Download Harbor Installer
Download Harbor installer
curl -s api.github.com... | grep browser_download_url | cut -d '"' -f 4 | grep '\.tgz$' | wget -i -
tar zxvf harbor-offline-installer-v*.tgz
cd harbor
ls -al
D) Configure Harbor
Let's Encrypt
sudo apt install certbot -y
sudo certbot certonly --standalone -d "harbor.xybernetics.com" --preferred-challenges http --agree-tos -n -m "rabi@xybernetics.com" --keep-until-expiring
After this, you will have certificates at /etc/letsencrypt/live/harbor.xybernetics.com/
Self signed certificate
mkdir -p certs
openssl req \
-newkey rsa:4096 -nodes -sha256 -keyout certs/harbor.key \
-addext "subjectAltName = DNS:harbor.xybernetics.com" \
-x509 -days 365 -out certs/harbor.crt
sudo cp certs/harbor.* /etc/ssl/certs/
nano harbor.yml.tmpl
Change these parameters
- "hostname"
- "harbor_admin_password"
- "database" paramters.
- https
* Comment out https if you are not using it.
* If you are using https, this is what it should look like.
https:
https port for harbor, default is 443
port: 443
The path of cert and key files for nginx
certificate: /etc/ssl/certs/harbor.crt
private_key: /etc/ssl/certs/harbor.key
Save as this filename (drop the .tmpl)
harbor.yml
Verify configurations
cat harbor.yml
E) Install Harbor
docker image ls
docker container ls
./install.sh
docker image ls
docker container ls
F) Test Harbor web access
IP_ADDRESS
OR
IP_ADDRESS
Default credentials
Username: admin
Password: Harbour12345
#docker #harbor #ubuntu
♥♥
thank you so much, for a clear info on Harbor registry.
you don't have lots of subscribers and very few views. But this is a life saver. More power to you, I hope your channel grow and help people
Thank you so much, this was the video I have been looking for.
good video with great pacing. Hoping you could do a follow up video for harbor and certs
Thanks, will do!
Learn how to install Harbor on an Ubuntu machine or in your VMWare.
Thanks for the demonstration
Very useful 👍
Glad you think so!
DUDE THANK U SO MUCH ,REALLY
Very useful thanks ❤
Thank you
what if port 80 is already in use?
Hello. Thank you for this video. I want to install Harbor in a Rocky Linux VM that I have, are the installation steps same?
how we will push the images to this Harbor please details it