Harbor部署
安装docker-compose前需要部署的步骤
要下载并安装撰写 CLI 插件,请运行:
DOCKER_CONFIG=KaTeX parse error: Expected '}', got 'EOF' at end of input: …DOCKER_CONFIG:-HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
[root@harbor ~]# DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
[root@harbor ~]# mkdir -p $DOCKER_CONFIG/cli-plugins
[root@harbor ~]# ls -a
. anaconda-ks.cfg .bash_logout .bashrc .docker .viminfo
.. .bash_history .bash_profile .cshrc .tcshrc
[root@harbor ~]# ls .docker/
cli-plugins
[root@harbor ~]#
[root@harbor ~]# curl -SL https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
[root@harbor ~]# cd /root/.docker/cli-plugins/
[root@harbor cli-plugins]# ls
docker-compose-linux-x86_64.octet-stream
[root@harbor cli-plugins]# mv docker-compose-linux-x86_64.octet-stream docker-compose
[root@harbor cli-plugins]# pwd
/root/.docker/cli-plugins
[root@harbor cli-plugins]# cd
[root@harbor ~]#
给它一个执行权限
[root@harbor cli-plugins]# chmod +x docker-compose
[root@harbor cli-plugins]# ll
total 25188
-rwxr-xr-x. 1 root root 25792512 Aug 11 21:54 docker-compose
把它链接起来
[root@harbor cli-plugins]# pwd
/root/.docker/cli-plugins
[root@harbor cli-plugins]# ln -s /root/.docker/cli-plugins/docker-compose /usr/bin/
这些能显示出来就说明装好了
[root@harbor cli-plugins]# cd
[root@harbor ~]# which docker-compose
/usr/bin/docker-compose
[root@harbor ~]#
[root@harbor cli-plugins]# cd
[root@harbor ~]# which docker-compose
/usr/bin/docker-compose
[root@harbor ~]# docker compose version
Docker Compose version v2.7.0
[root@harbor ~]#
去网上把harbor-offline-installer-v2.5.3.tgz这个把下载好然后用远程传进来
[root@harbor ~]# ls
anaconda-ks.cfg harbor-offline-installer-v2.5.3.tgz
[root@harbor ~]#
解压
[root@harbor ~]# tar xf harbor-offline-installer-v2.5.3.tgz -C /usr/local
[root@harbor ~]# cd /usr/local/
[root@harbor local]# ls
bin etc games harbor include lib lib64 libexec sbin share src
[root@harbor local]#
先修改主机名
[root@harbor ~]# hostnamectl set-hostname harbor.example.com
[root@harbor ~]# bash
[root@harbor ~]#
没有就复制一个然后修改配置文件
[root@harbor local]# cd harbor/
[root@harbor harbor]#
[root@harbor harbor]# ls
common.sh harbor.yml.tmpl LICENSE
harbor.v2.5.3.tar.gz install.sh prepare
[root@harbor harbor]# cp harbor.yml.tmpl harbor.yml
[root@harbor harbor]#
[root@harbor harbor]# vim harbor.yml
[root@harbor harbor]# cat harbor.yml
# Configuration file of Harbor
# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: harbor.example.com //这里是主机名,改成harbor.exam