前言
部署harbor
- 下载安装包
mkdir harbor && cd harbor
wget https://storage.googleapis.com/harbor-releases/release-1.9.0/harbor-offline-installer-v1.9.1.tgz
- 修改配置文件
tar -xf harbor-offline-installer-v1.9.1.tgz
cd harbor
vim harbor.yml
hostname: 192.168.100.10 #修改为自己的IP地址或者域名
port:810 #修改nginx端口,如果80端口给占用则修改,不占用则根据自己需要来修改
- 安装以及管理
# 启动安装
./install.sh
# docker 管理由docker-compose来管理
yum -y install docker-compose
docker-compose stop
docker-compose up -d
docker-compose top
- help文件
build Build or rebuild services
bundle Generate a Docker bundle from the Compose file
config Validate and view the Compose file
create Create services
down Stop and remove containers, networks, images, and volumes
events Receive real time events from containers
exec Execute a command in a running container
help Get help on a command
images List images
kill Kill containers
logs View output from containers
pause Pause services
port Print the public port for a port binding
ps List containers
pull Pull service images
push Push service images
restart Restart services
rm Remove stopped containers
run Run a one-off command
scale Set number of containers for a service
start Start services
stop Stop services
top Display the running processes
unpause Unpause services
up Create and start containers
version Show the Docker-Compose version information
- 账号密码
账号:root
密码:看配置文件,默认Harbor12345
-
页面
页面
harbor 简单使用
-
docker 登录
登录 -
推送
# james 是用户名
docker tag SOURCE_IMAGE[:TAG] 192.168.0.71:810/james/IMAGE[:TAG]
docker tag SOURCE_IMAGE[:TAG] 192.168.0.71:810/james/IMAGE[:TAG]
docker push 192.168.0.71:810/james/IMAGE[:TAG]
常见问题
-
问题一
现象 - 解决办法
# 查看docker 配置文件
systemctl status docker
# 修改配置文件
vim /usr/lib/systemd/system/docker.service
添加 --insecure-registry=192.168.0.71:810 # harbor地址
# 刷新
systemctl daemon-reload && systemctl restart docker
修改位置
-
问题二
现象 - 解决办法
# 查看harbor是否在运行
docker ps -a 或者 docker-compose ps
# 在harbor目录启动harbor
docker-compose up -d
网友评论