山东建设管理局网站,一般通过人体的电流超过多大,免费文件外链网站,百度官网推广平台Ubuntu安装harbor#xff08;http模式#xff09;
docker和harbor的介绍就免了#xff0c;都不知道啥东西#xff0c;还安装搞毛
先安装docker环境
不要问#xff0c;软件源之类的配置#xff0c;挨个梭就行 sudo apt update sudo apt install apt-transport-https ca…Ubuntu安装harborhttp模式
docker和harbor的介绍就免了都不知道啥东西还安装搞毛
先安装docker环境
不要问软件源之类的配置挨个梭就行 sudo apt update sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository “deb [archamd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable” 必要梭哈的搞完了正式安装docker sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io 验证是否正常 sudo systemctl status docker 安装harbor
github选版本下载 下载的tgz文件放到/usr/local解压 cd /usr/local tar -xvf harbor-offline-installer-v2.8.3.tgz cd harbor cp harbor.yml.tmpl harbor.yml #复制一份修改万一发生万一了有个复原的 vim harbor.yml 80端口容易冲突有个nginx什么的但是80端口好用啊 Https搞不明白的建议注释掉写博客的时候我已经注释了 蓝色的是默认密码记一下就行不用改 保存退出执行安装指令 sudo ./install.sh 打开浏览器访问地址http://ip:port/harbor我的本机不加/harbor老是跳转到https admin/Harbor12345 登录
上传一个镜像
登录到harbor的管理系统后在项目选择新建项目
先登录 docker login hostname(harbor.yml配置的那个) 先看一下本地都有些啥镜像 docker images 反正就是为了推一个镜像测试功能新搞一个helloWorld的镜像上传也行找个现成的推一下也行 docker images列表刚刚安装haibor保底有以下的镜像 用最小的goharbor做示例添加一个tag docker tag goharbor/registry-photon:v2.8.2 hostname/test/registry:v1 使用docker images能看到镜像列表多了一行 docker push hostname/test/registry:v1 提示成功后去harbor管理系统打开test查看
问题和处理
denied: requested access to the resource is denied 分析 未登录 或 登录别的地址 或 push的地址不对。 办法 docker login xxxx没有这个地址默认登陆到dockerhub了之前登录成功过会自动验证通过。harbor默认账密admin/Harbor12345 登录是成功的考虑推送的地址有问题打开系统看一下正确的应该是啥格式 Error response from daemon: Get “https://xx.xx.xx.xx/v2/”: dial tcp xx.xx.xx.xx:443: connect: connection refused
分析 harbor地址是http的但是你的docker链接的时候非要用https导致绿驴唇不对马嘴 办法 修改docker.service文件,文件位置/usr/lib/systemd/system/docker.service docker不放心的也可以查找一下 find / -name “docker.service” 原 ExecStart/usr/bin/dockerd -H fd:// --containerd/run/containerd/containerd.sock 新 ExecStart/usr/bin/dockerd --insecure-registryx.x.x.x #你的harborIP 然后重启一下如果发现重启报错删除daemon.json文件的insecure-registries systemctl daemon-reload systemctl restart docker Error response from daemon: Get https://xxxx.xxxx.xxx/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) 分析 系统不认识你的域名解析蒙了 办法 修改/etc/hosts 添加一行 x.x.x.x yyy.com read tcp read: connection reset by peer 没记住是啥原因没方向瞎折腾的时候出现过来来回回忘了怎么解决的了