跳到主要内容

Harbor 安装部署

· 阅读需 1 分钟

Harbor 安装部署

使用docker-compose安装

docker-compose 安装

下载安装包

wget https://github.com/docker/compose/releases/download/1.28.6/docker-compose-Linux-x86_64

授权并移动

chmod +x docker-compose-Linux-x86_64
mv docker-compose-Linux-x86_64 /usr/local/sbin/docker-compose

查看是否生效

docker-compose version

docker-py version: 4.4.4
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019

Harbor 安装

下载 解压安装包

wget https://github.com/goharbor/harbor/releases/download/v2.2.2/harbor-offline-installer-v2.2.2.tgz

tar -zxvf harbor-offline-installer-v2.2.2.tgz

修改配置

cp harbor.yml.tmpl harbor.yml

vim harbor.yml

hostname: harbor
harbor_admin_password: harbor12345 # admin的密码
#如果不用443,可以注释掉 https 那个模块
data_volume: /data # 存储路径

安装并验证

# 执行脚本安装
sh install.sh

# 验证
docker ps -a

MAC brew下载报错

· 阅读需 2 分钟

MAC brew下载报错

编译 wget 报错

configure: error: in `/Users/macbook/Software/wget-1.21.2':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

尝试下载相关依赖,和使用--with=openssl 都没有解决

解决方案

# 更换 brew 源,将 brew 默认的 github 源更换为阿里源解决:

使用 阿里云 的 Homebrew 镜像源进行加速

执行 brew 命令安装应用的时候,跟以下 3 个仓库地址有关:

  • brew.git
  • homebrew-core.git
  • homebrew-bottles
更换 brew.git
cd "$(brew --repo)"

git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
更换 homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
更换 homebrew-bottles

这与当前 macOS 系统使用的 shell 版本有关系,执行以下命令查看 Shell版本:

echo $SHELL
# 根据版本不同,会输出2种结果,/bin/zsh 或 /bin/bash,根据类型进行操作即可
  • /bin/zsh 结果
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc

source ~/.zshrc
  • /bin/bash 结果
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile

source ~/.bash_profile

再次下载 wget

brew install wget 

# yeah~ sccuess