harbor鏡像倉庫部署簡要筆記

1、安裝docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

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

驗證安裝:
[root@basic harbor]# docker-compose -v
docker-compose version 1.24.0, build 0aa59064

2、harbor下載
github官網 https://github.com/goharbor/harbor/releases
可以離線安裝或在線安裝,我這裏採用離線安裝,直接將最新的offline包下載到本地
wget https://storage.googleapis.com/harbor-releases/release-1.7.0/harbor-offline-installer-v1.7.5.tgz
harbor鏡像倉庫部署簡要筆記

3、解壓並修改harbor.cfg配置文件
[root@basic ~]# tar zxf harbor-offline-installer-v1.7.5.tgz
[root@basic ~]# cd harbor
[root@basic harbor]# cat harbor.cfg |grep -E "hostname|admin_pass"|grep -v ^#
hostname = 10.0.2.10
harbor_admin_password = Harbor12345
[root@basic harbor]#

主要修改hostname和harbor 的admin默認密碼

4、執行./prepare,更新一下配置文件
5、執行./install.sh,開始安裝並啓動
6、測試登錄
harbor鏡像倉庫部署簡要筆記
7、後續維護
cd到harbor目錄
直接docker-compose ps 查看相關容器Up信息
harbor鏡像倉庫部署簡要筆記

如果harbor系統出現異常,也可以在harbor目錄直接運行 docker-compose up -d 將會在後臺啓動並運行所有的容器。詳細參數請參考docker-compose官方說明:
[root@basic harbor]# docker-compose --help
Define and run multi-container applications with Docker.

Usage:
docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...]
docker-compose -h|--help

Options:
-f, --file FILE Specify an alternate compose file
(default: docker-compose.yml)
-p, --project-name NAME Specify an alternate project name
(default: directory name)
--verbose Show more output
--log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
--no-ansi Do not print ANSI control characters
-v, --version Print version and exit
-H, --host HOST Daemon socket to connect to

--tls Use TLS; implied by --tlsverify
--tlscacert CA_PATH Trust certs signed only by this CA
--tlscert CLIENT_CERT_PATH Path to TLS certificate file
--tlskey TLS_KEY_PATH Path to TLS key file
--tlsverify Use TLS and verify the remote
--skip-hostname-check Don't check the daemon's hostname against the
name specified in the client certificate
--project-directory PATH Specify an alternate working directory
(default: the path of the Compose file)
--compatibility If set, Compose will attempt to convert keys
in v3 files to their non-Swarm equivalent

Commands:
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@basic harbor]#

參考鏈接:
https://docs.docker.com/compose/install/
https://blog.51cto.com/11093860/2117805
http://wiki.jikexueyuan.com/project/docker-technology-and-combat/commands.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章