https://github.com/goharbor/harbor/releases
#上传压缩包到linux,并解压
tar -xzf harbor-offline-installer-v2.1.0_2.tgz
mkdir /opt/harbor
mv harbor/* /opt/harbor
cd /opt/harbor
3|0修改Harbor的配置
#没有的话复制harbor.yml.tmpl
vi harbor.yml
修改hostname和port
hostname: 172.21.3.23
port: 80
#注释掉https这段
# https related config
#https:
# https port for harbor, default is 443
# port: 443
# The path of cert and key files for nginx
# certificate: /your/certificate/path
#private_key: /your/private/key/path
4|0安装Harbor
./install.sh
5|0启动、停止Harbor
docker-compose up -d 启动
docker-compose stop 停止
docker-compose restart 重新启动
[root@k8s-n1 harbor]# docker login 172.21.3.23
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
9|0上传镜像
$docker push 172.21.3.23/library/nginx:latest
The push refers to repository [172.21.3.23/library/nginx]
6c7de695ede3: Pushed
2f4accd375d9: Pushed
ffc9b21953f4: Pushed
latest: digest: sha256:8269a7352a7dad1f8b3dc83284f195bac72027dd50279422d363d49311ab7d9b size: 948