Skip to content

Instantly share code, notes, and snippets.

@yangl
Last active November 2, 2018 08:58
Show Gist options
  • Save yangl/5ef51d920e1452ee1bd6ebbde274ed9a to your computer and use it in GitHub Desktop.
Save yangl/5ef51d920e1452ee1bd6ebbde274ed9a to your computer and use it in GitHub Desktop.
harbor相关

下载

https://github.com/goharbor/harbor/blob/master/docs/user_guide.md#manage-helm-charts

配置

vi harbor.cfg配置主机名即可(注添加hosts)

hostname = harbor.c1.com

安装

./install.sh --help

Note: Please set hostname and other necessary attributes in harbor.cfg first. DO NOT use localhost or 127.0.0.1 for hostname, because Harbor needs to be accessed by external clients. Please set --with-notary if needs enable Notary in Harbor, and set ui_url_protocol/ssl_cert/ssl_cert_key in harbor.cfg bacause notary must run under https. Please set --with-clair if needs enable Clair in Harbor Please set --with-chartmuseum if needs enable Chartmuseum in Harbor

./install.sh --with-chartmuseum

--with-chartmuseum参数打开helm仓库功能,注该功能需1.6.0及以上版本

访问

浏览器访问harbor.c1.com

docker push镜像

docker tag ubuntu:latest harbor.c1.com/dev/ubuntu:v1

docker push harbor.c1.com/dev/ubuntu:v1

helm仓库

helm repo add sf http://harbor.c1.com/chartrepo --username admin --password Harbor12345

添加docker私服

cat /etc/docker/daemon.json root@harbor

{ "insecure-registries": ["http://harbor.c1.com"], "registry-mirrors": ["https://xh0zf0vj.mirror.aliyuncs.com"] }

systemctl restart docker.service

docker推送

docker build . -t harbor.c1.com/library/spring-boot-helm-demo:v1

docker push harbor.c1.com/library/spring-boot-helm-demo:v1

helm upgrade --install --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment