环境:18.04.1-Ubuntu
安装docker参考链接https://docs.docker.com/engine/install/ubuntu/
具体如下:
更新apt & 允许使用httpssudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-relea
添加gpk key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
设置稳定的安装源 (arm芯片机器执行自行参考链接原文)
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_relea -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
安装docker
sudo apt-get updatesudo apt-get install docker-ce docker-ce-cli containerd.io
使用https证书
离线环境不装这个也行
下载acme配置邮箱 邮箱请替换成实际的wget -O - https://get.acme.sh | sh -s email=xxx@xxx.com
安装成功如下
--2021-03-19 08:05:43-- https://get.acme.sh/Resolving get.acme.sh (get.acme.sh)... 104.21.34.62, 172.67.199.16, 2606:4700:3031::ac43:c710, ...Connecting to get.acme.sh (get.acme.sh)|104.21.34.62|:443... connected.HTTP request nt, awaiting respon... 200 OKLength: unspecified [text/html]Saving to: ‘STDOUT’- [ <=> ] 937 --.-KB/s in 0s 2021-03-19 08:05:44 (25.8 MB/s) - written to stdout [937] % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 204k 100 204k 0 0 4650k 0 --:--:-- --:--:-- --:--:-- 4650k[Fri Mar 19 08:05:44 UTC 2021] Installing from online archive.[Fri Mar 19 08:05:44 UTC 2021] Downloading https://github.com/acmesh-official/acme.sh/archive/master.tar.gz[Fri Mar 19 08:05:45 UTC 2021] Extracting master.tar.gz[Fri Mar 19 08:05:45 UTC 2021] It is recommended to install socat first.[Fri Mar 19 08:05:45 UTC 2021] We u socat for standalone rver if you u standalone mode.[Fri Mar 19 08:05:45 UTC 2021] If you don't u standalone mode, just ignore this warning.[Fri Mar 19 08:05:45 UTC 2021] Installing to /root/.acme.sh[Fri Mar 19 08:05:45 UTC 2021] Installed to /root/.acme.sh/acme.sh[Fri Mar 19 08:05:45 UTC 2021] Installing alias to '/root/.bashrc'[Fri Mar 19 08:05:45 UTC 2021] OK, Clo and reopen your terminal to start using acme.sh[Fri Mar 19 08:05:45 UTC 2021] Installing cron jobno crontab for rootno crontab for root[Fri Mar 19 08:05:45 UTC 2021] Good, bash is found, so change the shebang to u bash as preferred.[Fri Mar 19 08:05:45 UTC 2021] OK[Fri Mar 19 08:05:45 UTC 2021] Install success!
生成证书
export Ali_Key="LTAI4FmiHYjQAr32GkmkjAfH" && export Ali_Secret="bk7IXxKVHcoVsmf4mP8N85ANkNgsMi" ;acme.sh --issue --dns dns_ali -d "*.test.com"
结果有下面的
-----END CERTIFICATE-----[Fri Mar 19 08:08:26 UTC 2021] Your cert is in /root/.acme.sh/*.test.com/*. .com.cer [Fri Mar 19 08:08:26 UTC 2021] Your cert key is in /root/.acme.sh/*.test.com/*.test.com.key [Fri Mar 19 08:08:26 UTC 2021] The intermediate CA cert is in /root/.acme.sh/*.test.com/ca.cer [Fri Mar 19 08:08:26 UTC 2021] And the full chain certs is there: /root/.acme.sh/*.test.com/fullchain.cer
注意 key 用 这个 /root/.acme.sh/*.test.com/*.test.com.key
CA 用 /root/.acme.sh/*.test.com/fullchain.cer 用第一个会有问题
安装harborgithub拿最新的tar包 解压到服务器https://github.com/goharbor/harbor/releas
安装docker compohttps://github.com/docker/compo/releas
去上面的地址下载一个 docker-compo-Linux-x86_64
cp docker-compo-Linux-x86_64 /usr/local/bin/docker-compochmod +x /usr/local/bin/docker-compo
在线安装harbor
https://github.com/goharbor/harbor/releas
解压harbor-online-installer-v2.2.1.tgz
修改解压后的配置文件 harbor.yml.tmpl
修改hostname和证书位置 如果不需要https 可以不配
# The IP address or hostname to access admin UI and registry rvice.# DO NOT u localhost or 127.0.0.1, becau Harbor needs to be accesd by external clients.hostname: reg.mydomain.com
# https related confighttps: # https port for harbor, default is 443 port: 443 # The path of cert and key files for nginx certificate: /your/certificate/path private_key: /your/private/key/path
修改密码的配置 默认是admin Harbor12345
# Remember Change the admin password from UI after launching Harbor.harbor_admin_password: Harbor12345
把文件改名
mvharbor.yml.tmplharbor.yml
下面一键安装
root@test-harbor:/harbor# ./install.sh [Step 0]: checking if docker is installed ...Note: docker version: 20.10.5[Step 1]: checking docker-compo is installed ...Note: docker-compo version: 1.28.5[Step 2]: preparing environment ...[Step 3]: preparing harbor configs ...prepare ba dir is t to /harborno config file: /harbor/harbor.ymlroot@test-harbor:/harbor# cp harbor.yml.tmpl harbor.ymlroot@test-harbor:/harbor# Digest: sha256:5721c120d6e44e1bdc3b9c0d56af57848430cabe5bbca415ff9f353c2f53024aStatus: Downloaded newer image for goharbor/nginx-photon:v2.1.4Creating harbor-log ... doneCreating harbor-portal ... doneCreating harbor-db ... doneCreating registryctl ... doneCreating redis ... doneCreating registry ... doneCreating harbor-core ... doneCreating harbor-jobrvice ... doneCreating nginx ... done✔ ----Harbor has been installed and started successfully.----root@test-harbor:/harbor#
下面就可以登录harbor 新建项目了 比如新建config项目
其他操作
后台登录harbor镜像库
docker login -u admin -p Harbor12345 azure.test.com
push镜像
docker push azure.test.com/config/relea:21.02.R1
可以在下面看到了
本文发布于:2023-02-28 21:03:00,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/zhishi/a/1677719996101570.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:gpk文件怎么安装(gpk是什么安装包).doc
本文 PDF 下载地址:gpk文件怎么安装(gpk是什么安装包).pdf
留言与评论(共有 0 条评论) |