docker-harbor私有仓库使用笔记
1. 登录harbor管理页面,创建项目,比如yuqx_test

2. admin登录,此处免密登录,正常情况下会输入账号密码
[root@k8s-rancher2 ~]# docker login 1.1.1.1:2021
Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store Login Succeeded
[root@k8s-rancher2 ~]#
3. 查看本地镜像列表
[root@k8s-rancher2 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
1.1.1.1:2021/yuqx/php-fpm 7.4.20 c7588980b561 9 days ago 937MB
redis 6.2.5 ddcca4b8a6f0 2 weeks ago 105MB
nginx latest dd34e67e3371 2 weeks ago 133MB
mariadb 10.6.4 45eaeedf03de 3 weeks ago 409MB
php fpm-alpine 1daa2d1ff198 3 weeks ago 83.8MB
4. 给镜像打tag
[root@k8s-rancher2 ~]# docker tag redis:6.2.5 1.1.1.1:2021/yuqx_test/redis:6.2.5
[root@k8s-rancher2 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
1.1.1.1:2021/yuqx/php-fpm 7.4.20 c7588980b561 9 days ago 937MB
1.1.1.1:2021/yuqx_test/redis 6.2.5 ddcca4b8a6f0 2 weeks ago 105MB
redis 6.2.5 ddcca4b8a6f0 2 weeks ago 105MB
nginx latest dd34e67e3371 2 weeks ago 133MB
mariadb 10.6.4 45eaeedf03de 3 weeks ago 409MB
php fpm-alpine 1daa2d1ff198 3 weeks ago 83.8MB
rancher/rancher-agent v2.5.9 ebd5d4b8d7aa 6 weeks ago 536MB
5. push到远程仓库
[root@k8s-rancher2 ~]# docker push 1.1.1.1:2021/yuqx_test/redis:6.2.5
The push refers to repository [1.1.1.1:2021/yuqx_test/redis]
0083597d42d1: Pushed
992463b68327: Pushed
4be6d4460d36: Pushed
ec92e47b7c52: Pushed
b6fc243eaea7: Pushed
f68ef921efae: Pushed
6.2.5: digest: sha256:eda375fa1d5b3c1b9c81a591bd4bc9934a2f45b346d36ef1aeafcf36212835d2 size: 1574
[root@k8s-rancher2 ~]#
6. 上传成功后,打开harbor管理页即可看见刚刚上传的redis镜像。(可在成员里添加项目的用户)


7. 退出登录
[root@k8s-rancher2 ~]# docker logout 1.1.1.1:2021
Removing login credentials for 1.1.1.1:2021
[root@k8s-rancher2 ~]#
8. pull远程仓库镜像
[root@k8s-rancher3 ~]# docker login 1.1.1.1:2021
Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[root@k8s-rancher3 ~]# docker pull 1.1.1.1:2021/yuqx_test/redis:6.2.5
6.2.5: Pulling from yuqx_test/redis
e1acddbe380c: Pull complete
a31098369fcc: Pull complete
4a49b0eba86d: Pull complete
fddf1399efac: Pull complete
5c6658b59b72: Pull complete
0b88638a5b77: Pull complete
Digest: sha256:eda375fa1d5b3c1b9c81a591bd4bc9934a2f45b346d36ef1aeafcf36212835d2
Status: Downloaded newer image for 1.1.1.1:2021/yuqx_test/redis:6.2.5
1.1.1.1:2021/yuqx_test/redis:6.2.5
[root@k8s-rancher3 ~]#
[root@k8s-rancher3 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
1.1.1.1:2021/yuqx_test/redis 6.2.5 ddcca4b8a6f0 2 weeks ago 105MB
apache/flink 1.13.2-scala_2.11 6046a5b9482c 3 weeks ago 632MB
[root@k8s-rancher3 ~]# docker logout 1.1.1.1:2021
Removing login credentials for 1.1.1.1:2021
[root@k8s-rancher3 ~]#
完毕。
常见问题:docker login
[root@web-dev1 yuqx]# docker login 1.1.1.1:2021
Username: admin
Password:
Error response from daemon: Get "https://1.1.1.1:2021/v2/": http: server gave HTTP response to HTTPS client
解决:daemon.json 加入insecure-registries配置,然后重启docker
[root@web-dev1 yuqx]# vim /etc/docker/daemon.json
1 {
2 "registry-mirrors": ["https://dockerhub.azk8s.cn","https://hub-mirror.c.163.com"],
3 "exec-opts": ["native.cgroupdriver=cgroupfs"],
4 "log-driver": "json-file",
5 "log-opts": {"max-size": "10m","max-file": "10"},
6 "insecure-registries":["1.1.1.1:2021"]
7 }
[root@web-dev1 yuqx]# systemctl restart docker
[root@web-dev1 yuqx]# docker login 1.1.1.1:2021
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store Login Succeeded
docker-harbor私有仓库使用笔记的更多相关文章
- Docker Harbor私有仓库部署与管理 (超详细配图)
Docker Harbor私有仓库部署与管理 1.Harbor 介绍 2.Harbor部署 3.Harbor管理 1.Harbor 介绍: 什么是 Harbor ? Harbor 是 VMware 公 ...
- Docker以http访问Harbor私有仓库(一)
1 说明 前文Centos7搭建Harbor私有仓库(一)我们成功搭建Harbor,本篇我们主要配置Docker以http方式访问私有仓库 2 Docker配置 2.1 Mac系统 2.1.1 配置D ...
- Docker以https访问Harbor私有仓库(二)
1 说明 前文Centos7搭建Harbor私有仓库(二)中,我们以https方式搭建了Harbor,本篇我们主要配置Docker以https方式访问Harbor私有仓库 2 Docker配置 2.1 ...
- 在jenkins中使用shell命令推送当前主机上的docker镜像到远程的Harbor私有仓库
1.jenkins主机上的docker配置 先在Jenkins主机的docke上配置上Harbor私有仓库地址 cat /etc/docker/daemon.json { "insecure ...
- 菜鸟系列docker——搭建私有仓库harbor(6)
docker 搭建私有仓库harbor 1. 准备条件 安装docker sudo yum update sudo yum install -y yum-utils device-mapper-per ...
- Harbor私有仓库中如何彻底删除镜像释放存储空间?
简介: Harbor私有仓库运行一段时间后,仓库中存有大量镜像,会占用太多的存储空间.直接通过Harbor界面删除相关镜像,并不会自动删除存储中的文件和镜像.需要停止Harbor服务,执行垃圾回收命令 ...
- 创建Harbor私有仓库
前提 1.安装docker服务 参考:https://blog.csdn.net/weixin_36522099/article/details/108861134 老名字:docker.docker ...
- 配置 Containerd 在 harbor 私有仓库拉取镜像
官方文档地址:https://github.com/containerd/cri/blob/master/docs/registry.md 严格来说,这个具体可分为两部分 1.在k8s中使用Conta ...
- 搭建harbor私有仓库
2-1.项目说明 Harbor是一个用于存储和分发Docker镜像的企业级Registry服务器,由VMware开源,其通过添加一些企业必需的功能特性,例如安全.标识和管理等,扩展了开源 Docke ...
- Python Docker 查看私有仓库镜像【转】
文章来源:python Docker 查看私有仓库镜像 pip 安装: # 首先安装epel扩展源: yum -y install epel-release # 更新完成之后,就可安装pip: yum ...
随机推荐
- js学习笔记之排序算法的原理及代码
冒泡排序 比较任何两个相邻的项,如果第一个比第二个大,则交换它们 重复这样的操作,直到排序完成,具体代码如下: let arr = [67,23,11,89,45,76,56,99] function ...
- Kubernetes安装报错总结
1.kubeadm init初使化报错 [root@k8s01 ~]# kubeadm init --kubernetes-version=v1.13.3 --pod-network-cidr=1 ...
- Bugku-你必须让他停下来
这道题使用burpsuite抓包就能做,一开始抓包发到repeater之后flag不一定可以直接得到,原因是flag藏在特定的那张图片后面,我们一直go到那张图片便可以得到flag. 进入题目给的网址 ...
- Vue-axios 封装了一手好axios:)
请求方式 很多种请求方式,重点还是第一种吧 下载 npm install axios --save 下载完成 直接导入 import axios from 'axios' 简单配置 axios({ u ...
- 进程信号的未决状态(pending status)
这两天看了apue有关进程信号的部分,觉得未决状态这个词很是不一般,呵呵.一开始当我看到这个词,我不理解,什么意思呢,读了好几遍.不知道是书里面讲的晦涩难懂,还是脑子越来越不行了,就是没有搞明白.后来 ...
- Linux平台上转换文件编码
Linux系统的iconv指令是一个很好的文件编码转换工具,支持的编码范围广,使用方便,例如将一个utf-8编码的文件(名为tic)转换为gbk编码: iconv -f utf-8 -t gbk ti ...
- 尝试通过 JDBC 将 UTF-8 插入 MySQL 时出现“乱码”
这是我的连接设置方式: Connection conn = DriverManager.getConnection(url + dbName + "?useUnicode=true& ...
- 你真的熟悉ASP.NET MVC的整个生命周期吗?
一.介绍 我们做开发的,尤其是做微软技术栈的,有一个方向是跳不过去的,那就是MVC开发.我相信大家,做ASP.NET MVC 开发有的有很长时间,当然,也有刚进入这个行业的.无论如何,如果有人问你,你 ...
- UDP与TCP的对比
参考网址:https://blog.csdn.net/m0_38121874/article/details/82914634 1.报头(1)TCP协议报头TCP指传输控制协议,其报头格式如下: TC ...
- 【js】--获取开始时间 和 截止时间中间的所有时间
1.工具函数 将[中国标准时间] 转换成 [年月日 时分秒] /* * timeStamp: 标准时间 例: 'Tue Sep 22 2020 00:00:00 GMT+0800 (中国标准时间)' ...