目录

一、使用aliyun的registry上传下载镜像https://cr.console.aliyun.com/cn-hangzhou/repositories

1.先在阿里云注册一个本地仓库

2.给镜像打上标签

3.在docker上登陆自己的阿里云账号

4.把镜像上传到阿里云

5.查看是否成功

6.删除本地镜像

7.下拉镜像到本地

二、使用registry镜像运行容器上传下载镜像


一、使用aliyun的registry上传下载镜像

https://cr.console.aliyun.com/cn-hangzhou/repositories

1.先在阿里云注册一个本地仓库

容器镜像服务 (aliyun.com)https://cr.console.aliyun.com/cn-hangzhou/instance/repositories

2.给镜像打上标签

[root@bingbing ~]# docker tag alpine:latest maxuedong/alpine:latest
[root@bingbing ~]# docker images

REPOSITORY         TAG       IMAGE ID       CREATED         SIZE
busybox            v1        0a141ab55662   4 hours ago     1.24MB
maxuedong/alpine   latest    9c6f07244728   11 days ago     5.54MB
alpine             latest    9c6f07244728   11 days ago     5.54MB
php                latest    4d6ad64a864a   2 weeks ago     484MB
nginx              latest    b692a91e4e15   2 weeks ago     142MB
busybox            latest    7a80323521cc   3 weeks ago     1.24MB
hello-world        latest    feb5d9fea6a5   11 months ago   13.3kB
tencentci/discuz   lasest    4833f513a33c   13 months ago   463MB

3.在docker上登陆自己的阿里云账号

[root@bingbing ~]# docker login --username=q1434870588 registry.cn-hangzhou.aliyuncs.com
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

4.把镜像上传到阿里云

[root@bingbing ~]# docker tag alpine:latest  registry.cn-hangzhou.aliyuncs.com/daroubaozi/dockers:v1

[root@bingbing ~]# docker push registry.cn-hangzhou.aliyuncs.com/daroubaozi/dockers:v1
The push refers to repository [registry.cn-hangzhou.aliyuncs.com/daroubaozi/dockers]
994393dc58e7: Pushed 
v1: digest: sha256:1304f174557314a7ed9eddb4eab12fed12cb0cd9809e4c28f29af86979a3c870 size: 528

5.查看是否成功

6.删除本地镜像

[root@bingbing ~]# docker image rm alpine:latest 
Untagged: alpine:latest
Untagged: alpine@sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad

7.下拉镜像到本地

[root@bingbing ~]# docker pull registry.cn-hangzhou.aliyuncs.com/daroubaozi/dockers:v1
v1: Pulling from daroubaozi/dockers
Digest: sha256:1304f174557314a7ed9eddb4eab12fed12cb0cd9809e4c28f29af86979a3c870
Status: Image is up to date for registry.cn-hangzhou.aliyuncs.com/daroubaozi/dockers:v1
registry.cn-hangzhou.aliyuncs.com/daroubaozi/dockers:v1

二、使用registry镜像运行容器上传下载镜像

1.拉取registry镜像

[root@bingbing ~]# docker pull registry

2.启动registry容器

[root@bingbing docker]# docker run --name registry -p 5000:5000 -v /data/registry:/var/lib/registry -d registry:2.6.2 

3.打上标签

[root@bingbing docker]# docker image tag nginx:1.14-alpine 49.234.46.66:5000/nginx:1.14

4.修改/etc/docker/daemon.json配置文件

[root@bingbing ~]# vim /etc/docker/daemon.json
[root@bingbing ~]# cat /etc/docker/daemon.json

{
registry-mirrors": ["https://jkeshucp.mirror.aliyuncs.com","https://mirror.ccs.tencentyun.com"],
  "insecure-registries": ["49.234.46.66:5000"]
}

5.重启docker和 重启容器

需要修改daemon.json 文件的后缀名为daemon.demo 不然会报错,重启后改回来

[root@bingbing docker]# sudo mv daemon.conf daemon.json

systemctl restart docker 
 docker restart registry

[root@bingbing docker]# sudo mv daemon.json daemon.conf

6.上传镜像

docker push 49.234.46.66:5000/nginx:1.14

7. 删除镜像

docker image rm 49.234.46.66:5000/nginx:1.14

8.拉取镜像

docker pull 49.234.46.66:5000/nginx:1.14

docker仓库的搭建居然只要一分钟!相关推荐

  1. docker仓库harbor搭建

    1.安装docker-compose 1 [root@docker02 ~]# yum install epel-release 2 [root@docker02 ~]# pip install do ...

  2. 互联网架构师必备技术 Docker仓库与Java应用服务动态发布那些事

    讲师简介: James老师 十余年Java经验,曾就职于携程.人人网等一线互联网公司,专注于java领域,精通软件架构设计,对于高并发.高性能服务有深刻的见解, 在服务化基础架构和微服务技术有大量的建 ...

  3. CentOS 7 搭建docker仓库

    docker已经足够火了,试想每次部署都要飘洋过海去docker官方仓库拉镜像,肯定受不了, 即使有了国内镜像,然而,频繁的docker部署,依然会让网速捉襟见肘. 所以必须搭建内网私有docker仓 ...

  4. 搭建Harbor企业级docker仓库

    from: https://www.cnblogs.com/pangguoping/p/7650014.html 搭建Harbor企业级docker仓库 一.Harbor简介 1.Harbor介绍 H ...

  5. Docker容器私有仓库——Harbor私有仓库的搭建

    Docker容器私有仓库--Harbor私有仓库的搭建 一.Harbor介绍 1.Harbor概念 2.Harbor的核心组件 3.Harbor的优点 二.Harbor搭建的环境准备 1.当前Harb ...

  6. 你必须知道的Docker镜像仓库的搭建

    近期工作中发现用到的容器镜像越来越多(不多的时候没考虑过镜像仓库的问题),同一个容器镜像也存在多个版本,那么镜像仓库的搭建需求就涌现出来,本文就目前的几个常用镜像仓库的搭建进行介绍,我们可以根据需要选 ...

  7. 【Docker】Registry搭建私有仓库、证书认证、用户登录认证

    一.Docker Registry工作原理 02_Docker Registry角色 Docker Registry有三个角色,分别是index.registry和registry client. i ...

  8. Docker容器之搭建本地私有仓库

    Docker容器之搭建本地私有仓库 前言 一.首先下载registry镜像 二.在daemon.json文件中添加私有镜像仓库的地址并重启 三.创建registry容器并开放端口 四.给镜像打标签后上 ...

  9. CentOS7搭建私有化Docker仓库Harbor

    CentOS7搭建私有化Docker仓库Harbor CentOS7搭建私有化Docker仓库Harbor Docker仓库Harbor下载 配置要求 硬件配置要求 软件配置要求 端口要求 安装依赖软 ...

  10. docker仓库——搭建registry私有仓库

    docker仓库 一.什么是仓库 二.docker hub 三.registry工作原理 四.配置镜像加速器 五.搭建私有仓库 1.导入registry镜像 2.添加证书和密钥 3.将证书给docke ...

最新文章

  1. (转)有了jQuery.Jcrop,选取美女的哪个部位你说了算
  2. C++ 莫队算法(转)
  3. BZOJ 3884 上帝与集合的正确用法 (欧拉定理)
  4. Android Stdio使用技巧
  5. 产品经理该如何全局思考和分析行业产业链?
  6. 【是泰波那契,不是斐波那契】1137. 第 N 个泰波那契数
  7. Javaweb-AJAX快速入门及案例实战
  8. linux 启动mongodb
  9. PHP读取数据库表显示到前台
  10. python时间序列分析航空旅人_python时间序列分析
  11. 在window下搭建TensorFlow
  12. java - 求最大公约数和最小公倍数
  13. 复旦大学计算机学院官网,Computer and Information Science
  14. 基于JAVA+SpringBoot+Mybatis+MYSQL的化妆品售卖系统
  15. Html表格lt;tablegt;还是须要加入一些标签进行优化,能够加入标题lt;captiongt;和摘要lt;table summarygt;...
  16. 商业计划书范文3000_大学生商业计划书范文
  17. python xlwt_python的xlwt模块
  18. 新win10计算机分区,预装win10系统新电脑怎么分区
  19. js 禁止鼠标菜单键及键盘快捷键
  20. Windows平台Qt添加OpenCV模块

热门文章

  1. spring学习(四)spring 持久层的封装
  2. 计算机上没有端口DOT4,dot4_001端口
  3. mysql修改变量立即生效_mysql变量修改及生效
  4. ubuntu桌面美化mac_教程:为你的linux桌面带来Mac OS Mojave的体验
  5. MSP430编程器仿真器JTAG、SBW、BSL接口的区别
  6. 科学计算IED--Anaconda软件基础操作
  7. php单元测试入门教程phpunit详解
  8. 谢烟客---------Linux之 sed工具使用
  9. 计算机视觉之目标检测(object detection)《1》
  10. pandoc输出中文pdf cmd命令记录