DEV Community

Fatih ASLAN
Fatih ASLAN

Posted on

Harbor Registry Kurulumu on Ubuntu20LTS

Harbor: Open source cloud native registry projesidir.
Image description

Biz direk ubuntu üzerinde docker container‘ler olarak kurulumu başlatacağız.

Docker kurulumuna başlamadan bridge0‘yu özelleştirebilirsiniz.

sudo mkdir /etc/docker

sudo vim /etc/docker/daemon.json


{
"bip": "192.168.81.1/24"
}
Enter fullscreen mode Exit fullscreen mode

Docker kuralım,

sudo apt install ca-certificates curl gnupg lsb-release -y

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | 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] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update

sudo apt install docker-ce docker-ce-cli containerd.io -y
Enter fullscreen mode Exit fullscreen mode

Docker Compose kuralım,

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

sudo chmod +x /usr/local/bin/docker-compose

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

sudo usermod -aG docker $USER
Enter fullscreen mode Exit fullscreen mode

Kurulum yapacağımız harbor versiyonunu indirelim,

wget https://github.com/goharbor/harbor/releases/download/v2.4.1/harbor-offline-installer-v2.4.1.tgz

tar xzf harbor-offline-installer-v2.4.1.tgz

cd harbor/

cp harbor.yml.tmpl harbor.yml
Enter fullscreen mode Exit fullscreen mode

Harbor kurulum öncesi kopyaladığmız “harbor.yml” dosyası üzerinde bir takım değişiklikler yapmanız gerekli, bu değişiklikleri ortamınıza uygun şekilde yapmanız gerekir,

vim harbor.yml

hostname: harbor.fatlan.com
http:
  port: 80
https:
  port: 443
  certificate: /home/fatlan/ssl/fatlancom.crt
  private_key: /home/fatlan/ssl/fatlancom.key
harbor_admin_password: Harbor12345
database:
  password: root123
data_volume: /data
Enter fullscreen mode Exit fullscreen mode

Son olarak harbor kurulum script‘imizi başlatalım.

./install.sh
Enter fullscreen mode Exit fullscreen mode

Akabinde başarılı olan kurulumumuz sonrası ui aracılığıyla da login olduğumuz registry‘imizi cli ile test edelim.

Docker image testi,

docker tag weaveworks/scope harbor.fatlan.com/library/weaveworks-scope

docker login https://harbor.fatlan.com

docker push harbor.fatlan.com/library/weaveworks-scope

docker pull harbor.fatlan.com/library/weaveworks-scope
Enter fullscreen mode Exit fullscreen mode

Helm Chart testi,

helm create fatihcharts (after changed)

touch index.yaml

helm repo index . --url https://harbor.fatlan.com/mycharts

helm package fatihcharts {yada cd fatihcharts, helm package .}

helm registry login https://harbor.fatlan.com {export HELM_EXPERIMENTAL_OCI=1 gerekebilir}

helm push fatihcharts-0.1.0.tgz oci://harbor.fatlan.com/mycharts/

helm pull oci://harbor.fatlan.com/mycharts/fatihcharts
Enter fullscreen mode Exit fullscreen mode

Top comments (0)