Harbor - 企业级 Docker 私有仓库
一、Docker Compose 安装
[root@localhost ~]# yum -y install epel-release [root@localhost ~]# yum -y install python-pip [root@localhost ~]# pip --version pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7) [root@localhost ~]# pip install --upgrade pip
[root@localhost ~]# pip install docker-compose
编译中断。 error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-SF_hPB/subprocess32/setup.py'"'"'; __file__='"'"'/tmp/pip-install-SF_hPB/subprocess32/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-MXLYK7/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
解决办法
yum install python-devel yum install libevent-devel pip install gevent
[root@localhost ~]# docker-compose version docker-compose version 1.25.0, build b42d419 docker-py version: 4.1.0 CPython version: 2.7.5 OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 2017
[root@localhost ~]# docker --version Docker version 19.03.5, build 633a0ea
[root@localhost ~]# tar -zxf harbor-offline-installer-v1.2.0.tgz [root@localhost ~]# cd harbor [root@localhost harbor]# vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.225 docker.ljj.cn [root@localhost harbor]# vi harbor.cfg hostname = docker.ljj.cn ui_url_protocol = https db_password = root123 max_job_workers = 3 customize_crt = on ssl_cert = /data/cert/server.crt ssl_cert_key = /data/cert/server.key
[root@localhost harbor]# mkdir -p /data/cert [root@localhost harbor]# cd /data/cert/
[root@localhost cert]# openssl genrsa -des3 -out server.key 2048 Generating RSA private key, 2048 bit long modulus ................+++ ......................................................................+++ e is 65537 (0x10001) Enter pass phrase for server.key: Verifying - Enter pass phrase for server.key: #密码123456 [root@localhost cert]# openssl req -new -key server.key -out server.csr Enter pass phrase for server.key: #输入123456 You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:CN State or Province Name (full name) []:SX Locality Name (eg, city) [Default City]:TY Organization Name (eg, company) [Default Company Ltd]:ZDC Organizational Unit Name (eg, section) []:ZDC Common Name (eg, your name or your server's hostname) []:docker.ljj.cn Email Address []:1350748936@qq.com Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: #直接回车 An optional company name []: #直接回车
[root@localhost cert]# cp server.key server.key.org [root@localhost cert]# openssl rsa -in server.key.org -out server.key Enter pass phrase for server.key.org: #退密码输入123456 writing RSA key
[root@localhost cert]# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt#转换成不带密码的证书。
Signature ok
subject=/C=CN/ST=SX/L=TY/O=ZDC/OU=ZDC/CN=docker.ljj.cn/emailAddress=1350748936@qq.com
Getting Private key
安装harbor
[root@localhost ~]# cd harbor [root@localhost harbor]# ./install.sh
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?