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 ...
随机推荐
- @ControllerAdvice全局异常处理不起作用原因及解决办法
这段时间使用springboot搭建基础框架,作为springboot新手,各种问题都有. 当把前端框架搭建进来时,针对所有controller层的请求,所发生的异常,需要有一个统一的异常处理,然后返 ...
- 程序员被老板要求两个月做个APP,要不比京东差,网友:做一个快捷方式,直接链到京东
隔行如隔山,这句话说得一点都没错.做一个程序员,很多人都会羡慕,也有很多人会望而却步. 作为一个外行人,你别看程序员每天坐在电脑前敲敲键盘打打代码,以为很简单,其实啊也只有程序员自己明白,任何一个看似 ...
- Linux中的DNS反解析
安装bind软件包 yum -y install bind 查找配置文件路径 修改系统配置文件 配置反向解析文件 修改网卡信息,关闭防火墙 测试实验
- Sqli-Labs less38-45
less-38 前置基础知识:堆叠注入 参考链接:https://www.cnblogs.com/lcamry/p/5762905.html 实际上就是多条sql语句一起使用. 在38关源码中加入输出 ...
- MySQL JOIN的使用
JOIN的使用 JOIN 理论 MySQL 七种 JOIN 的 SQL 编写 环境搭建 # 创建部门表 CREATE TABLE tbl_dept ( id INT NOT NULL AUTO_INC ...
- NOIP 模拟 $21\; \rm Median$
题解 \(by\;zj\varphi\) 对于这个序列,可以近似得把它看成随机的,而对于随机数列,每个数的分布都是均匀的,所以中位数的变化可以看作是常数 那么可以维护一个指向中位数的指针,同时维护有多 ...
- 题解 block
传送门 如果不想让next_permutation()自动忽略重复元素,可以在比较函数里加个rk之类的东西使它们不同(next_permutation()不用等于号) 关于第一问:貌似也是一个挺常见的 ...
- RocketMQ可视化控制台
中午文档 https://github.com/apache/rocketmq-externals/blob/master/rocketmq-console/doc/1_0_0/UserGuide_C ...
- Docker创建Docker-Registry客户端docker-registry-frontend
docker-compose.yml version: '3.1' services: frontend: image: konradkleine/docker-registry-frontend:v ...
- Qt元对象和属性系统详解
Qt 是一个用标准 C++ 编写的跨平台开发类库,它对标准 C++ 进行了扩展,引入了元对象系统.信号与槽.属性等特性,使应用程序的开发变得更高效. 本节将介绍 Qt 的这些核心特点,对于理解和编写高 ...