公司Harbor仓库使用说明
<h3>1、docker登录仓库报错</h3>
<h4>1.1、报错信息</h4>
<pre><code class="language-bash">docker login --username easytong --password Hzsun@310012 172.16.5.204
WARNING! Using --password via the CLI is insecure. Use --password-stdin.</code></pre>
<p>警告! 通过CLI使用--password是不安全的。 使用--password-stdin。</p>
<h4>1.2、使用--password-stdin</h4>
<pre><code class="language-bash">vim /home/build/password.txt 内容如下:
Hzsun@310012
docker login --username easytong --password-stdin < /home/easytong/password.txt 172.16.5.204</code></pre>
<h3>2、Client访问5.204 harbor仓库报错</h3>
<pre><code class="language-bash">Error response from daemon: Get https://172.16.5.204/v2/: dial tcp 172.16.5.204:443: connect: connection refused</code></pre>
<h4>2.1. 在Client上添加如下文件及内容:</h4>
<pre><code class="language-bash">vim /etc/docker/daemon.json
{
"insecure-registries": [ "172.16.5.204" ]
}</code></pre>
<h4>2.2.添加后重启docker服务</h4>
<pre><code class="language-bash">systemctl restart docker</code></pre>
<h4>2.3、在Client上登录harbor仓库成功</h4>
<pre><code class="language-bash">docker login --username easytong --password-stdin < ./password.txt 172.16.5.204
WARNING! Your password will be stored unencrypted in /home/build/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded</code></pre>
<h3>3、上传镜像</h3>
<h4>3.1、打标签</h4>
<p>build环境加镜像生成后,还需要按仓库的要示打好标签才能上传镜像,打镜像标签:</p>
<pre><code class="language-bash">docker tag easytong_server:5.1.20.0531 172.16.5.204/easytong/easytong_server:5.1.20.0531</code></pre>
<h4>3.2、上传镜像至仓库</h4>
<p>在5.204的build环境上传镜像至仓库</p>
<pre><code class="language-bash">docker push 172.16.5.204/easytong/easytong_server:5.1.20.0531</code></pre>
<h3>4、在Client获取镜像</h3>
<p>在Client端,如172.16.7.61环境中,获取镜像使用。</p>
<pre><code class="language-bash">docker pull 172.16.5.204/easytong/easytong_server:5.1.20.0531</code></pre>
<h3>5、附 其它说明</h3>
<p>Harbor 1.8.0 仓库的安装和使用
data_volume: 存储 harbor 数据的位置
<a href="https://www.cnblogs.com/shiluoliming/p/11381851.html">https://www.cnblogs.com/shiluoliming/p/11381851.html</a>
登录说明:
<a href="https://www.cnblogs.com/phpper/p/12899895.html">https://www.cnblogs.com/phpper/p/12899895.html</a></p>