docker镜像仓库harbor安装部署

2019-10-31  本文已影响0人  无处安放的躁动

前言

部署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
  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 简单使用

# 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

参考文件

官方部署文档
推送相关参考文件

上一篇下一篇

猜你喜欢

热点阅读