Docker镜像与仓库(一)
Docker镜像与仓库(一)
Docker镜像与仓库(一)
如何查找镜像?
Docker Hub
https://registry.hub.docker.comdocker search [OPTIONS] TERM
参数:
1.--automated=false #Only show automated builds
2.--no-trunc=false #Don't truncate output
3.-s,--stars=0 #Only displays with at least x stars
最多返回25个结果
举个栗子,
1.[KANO@kelvin ~]$ docker search centos
2.INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
3.docker.io docker.io/centos The official build of CentOS. 1775 [OK]
4.docker.io docker.io/jdeathe/centos-ssh CentOS-6 6.7 x86_64 / EPEL/IUS Repos / Ope... 14 [OK]
5.docker.io docker.io/jdeathe/centos-ssh-apache-php CentOS-6 6.7 x86_64 / Apache / PHP / PHP m... 11 [OK]
6.docker.io docker.io/million12/centos-supervisor Base CentOS-7 with supervisord launcher, h... 9 [OK]
7.docker.io docker.io/blalor/centos Bare-bones base CentOS 6.5 image 8 [OK]
8.docker.io docker.io/nimmis/java-centos This is docker images of CentOS 7 with dif... 7 [OK]
9.docker.io docker.io/torusware/speedus-centos Always updated official CentOS docker imag... 7 [OK]
10.docker.io docker.io/jdeathe/centos-ssh-mysql CentOS-6 6.7 x86_64 / MySQL. 4 [OK]
11.docker.io docker.io/consol/centos-xfce-vnc Centos container with "headless" VNC sessi... 3 [OK]
12.docker.io docker.io/nathonfowlie/centos-jre Latest CentOS image with the JRE pre-insta... 3 [OK]
13.docker.io docker.io/consol/sakuli-centos-xfce Sakuli end-2-end testing and monitoring co... 2 [OK]
14.docker.io docker.io/nickistre/centos-lamp LAMP on centos setup 2 [OK]
15.docker.io docker.io/layerworx/centos CentOS container with etcd, etcdctl, confd... 1 [OK]
16.docker.io docker.io/lighthopper/orientdb-centos A Dockerfile for creating an OrientDB imag... 1 [OK]
17.docker.io docker.io/nathonfowlie/centos-jira JIRA running on the latest version of CentOS 1 [OK]
18.docker.io docker.io/nickistre/centos-lamp-wordpress LAMP on CentOS setups with wp-cli installed 1 [OK]
19.docker.io docker.io/softvisio/centos Centos 1 [OK]
20.docker.io docker.io/yajo/centos-epel CentOS with EPEL and fully updated 1 [OK]
21.docker.io docker.io/blacklabelops/centos Blacklabelops Centos 7.1.503 base image wi... 0 [OK]
22.docker.io docker.io/januswel/centos yum update-ed CentOS image 0 [OK]
23.docker.io docker.io/jsmigel/centos-epel Docker base image of CentOS w/ EPEL installed 0 [OK]
24.docker.io docker.io/labengine/centos Centos image base 0 [OK]
25.docker.io docker.io/lighthopper/openjdk-centos A Dockerfile for creating an OpenJDK image... 0 [OK]
26.docker.io docker.io/pdericson/centos Docker image for CentOS 0 [OK]
27.docker.io docker.io/timhughes/centos Centos with systemd installed and running 0 [OK]
28.[KANO@kelvin ~]$ docker search -s 3 centos
29.INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
30.docker.io docker.io/centos The official build of CentOS. 1775 [OK]
31.docker.io docker.io/jdeathe/centos-ssh CentOS-6 6.7 x86_64 / EPEL/IUS Repos / Ope... 14 [OK]
32.docker.io docker.io/jdeathe/centos-ssh-apache-php CentOS-6 6.7 x86_64 / Apache / PHP / PHP m... 11 [OK]
33.docker.io docker.io/million12/centos-supervisor Base CentOS-7 with supervisord launcher, h... 9 [OK]
34.docker.io docker.io/blalor/centos Bare-bones base CentOS 6.5 image 8 [OK]
35.docker.io docker.io/nimmis/java-centos This is docker images of CentOS 7 with dif... 7 [OK]
36.docker.io docker.io/torusware/speedus-centos Always updated official CentOS docker imag... 7 [OK]
37.docker.io docker.io/jdeathe/centos-ssh-mysql CentOS-6 6.7 x86_64 / MySQL. 4 [OK]
38.docker.io docker.io/consol/centos-xfce-vnc Centos container with "headless" VNC sessi... 3 [OK]
39.docker.io docker.io/nathonfowlie/centos-jre Latest CentOS image with the JRE pre-insta... 3 [OK]
如何拉取镜像?
1.docker pull [OPTIONS] NAME[:TAG]
2.参数:
3. -a,--all-tags=false #Download all tagged images in the repository
实际在国内拉取镜像文件是很慢的,要想加速这一过程,可以使用国内的镜像站:
使用--registry-mirror
选项:
- 修改:/etc/default/docker
- 添加:
DOCKER_OPTS="--registry-mirror=http://MIRROR-ADDR"
MIRROR-ADDR可以使用譬如daocloud.io
注册账户然后生产一个地址,修改到/etc/default/docker
中。
如何将自己的镜像上传到docker hub上?
1.docker push NAME[:TAG]
如何构建镜像?
为何要构建镜像?
- 保存对容器的修改,并再次使用
- 自定义镜像的能力
- 以软件的形式打包并分发服务及其运行环境
docker提供了两种方式:
- 通过容器构建
1.docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
2.参数:
3. -a,--author="" #Author e.g.,"John Hannibal Smith hannibal@a-team.com"
4. -m,--message="" #Commit message
5. -p,--pause=true #Pause container during commit
- 通过Dockerfile文件构建
1.docker build
创建一个存放Dockerfile的目录
1.[KANO@kelvin ~]$ sudo mkdir -p dockerfile/test
2.[KANO@kelvin ~]$ cd dockerfile/test
3.[KANO@kelvin ~]$ sudo vi Dockerfile
创建第一个Dockerfile填入下面内容
1.#First Dockerfile
2.FROM centos:7
3.MAINTAINER kano "125439083@qq.com"
4.RUN yum update
5.RUN yum install -y nginx
6.EXPOSE 80
保存退出,然后就可以使用
1.docker build [OPTIONS] PATH | URL | -
2. --force-rm=false
3. --no-cache=false
4. --pull=false
5. -q,--quiet=false
6. --rm=true
7. -t,--tag=""
来构建
譬如进入文件目录中,运行
1.docker build -t="test" .
于是就完成了构建
Docker镜像与仓库(一)的更多相关文章
- 第四章 使用Docker镜像和仓库(二)
第四章 使用Docker镜像和仓库(二) 回顾: 开始学习之前,我先pull下来ubuntu和fedora镜像 [#9#cloudsoar@cloudsoar-virtual-machine ~]$s ...
- 第四章 使用Docker镜像和仓库
第4章 使用Docker镜像和仓库 回顾: 回顾如何使用 docker run 创建最基本的容器 $sudo docker run -i -t --name another_container_mum ...
- 04_Docker入门(下)之docker镜像和仓库的使用
docker镜像和仓库 镜像介绍 docker镜像是由文件系统叠加而成的.最低端是一个引导文件系统,即bootfs.当一个容器启动后,它会将被移动到内存中,而引导文件系统则会被卸载,以留出更多的内存以 ...
- Docker之- 使用Docker 镜像和仓库
目录 使用Docker 镜像和仓库 什么是 Docker 镜像 列出 Docker 镜像 tag 标签 Docker Hub 拉取镜像 查找镜像 构建镜像 创建Docker Hub 账号 使用 Doc ...
- docker镜像的仓库
一.docker镜像的仓库 --- repos-registry的创建: 仓库分为公共仓库和私有仓库 DockerHub的官方仓库 https://hub.docker.com DockerPool社 ...
- Docker镜像的仓库及底层依赖的核心技术(3)
一.docker镜像的仓库 仓库分为公共仓库和私有仓库 DockerHub的官方仓库:https://hub.docker.com DockerPool社区仓库:https://dl.dockerpo ...
- 《第一本docker书》第4章 使用docker镜像和仓库 读书笔记
docker最底端是一个引导文件系统,即bootfs. 第二层是root文件系统rootfs,位于引导文件系统之上. 在传统的Linux引导过程中,root文件系统会最先以只读的方式加载,当引导结束并 ...
- docker镜像与仓库
1.docker image 镜像 容器的基石 层叠的只读文件系统 联合加载(union mount) 2.镜像存储地址 /var/lib/docker 3.镜像操作 列出镜像 镜像标签和仓库 查 ...
- Docker镜像与仓库(二)Dockerfile
Docker镜像文件与仓库(二) Docker镜像文件与仓库(二) Dockerfile指令 Dockerfile格式: 1.#Comment注释2.INSTRUCTION大写的指令名 argumen ...
随机推荐
- 不使用TNS直连数据库的三种方式
1.在当前目录下新建tnsnames.ora文件 如windows环境下,在C:\Users\Administrator目录下新建tnsnames.ora文件,内容如下:test =(descript ...
- 关于js对象值的传递
结合红宝书和网上的一些文章,记录下自己对关于js对象的值的传递的一些理解. js对象是保存在堆内存中的,当把对象赋值给变量时,是把对象在堆内存的引用(地址)赋值给了变量,变量通过地址来访问对象.下面来 ...
- asp.net 导出excel文件
之前做过winfrom程序的导出excel文件的功能,感觉非常简单.现在试着做asp.net中导出excel的功能,之前用的是Microsoft.Office.Interop.Excel这个对象来实现 ...
- Android学习之Notification
Notification可以在手机的状态栏发出一则通知,它需要用NotificationManager来管理,实现Notification其实很简单. 1.通过getsystemservice方法获得 ...
- 蜗牛爱课- CGAffineTransformMakeRotation 实现一张图片的自动旋转
self.locationTimer =[NSTimer scheduledTimerWithTimeInterval: 0.01 target: self selector:@selector(tr ...
- 前端开发的常用js库
验证: jQuery formValidator,Validform; 提示框: artDialog, lhgDialog,jBox,jQuery textbox plugin 文件批量上传:uplo ...
- git撤销修改
在Git中,删除也是一个修改操作,我们实战一下,先添加一个新文件test.txt到Git并且提交: $ git add test.txt $ git commit -m "add test. ...
- HTTP中的URL长度限制(资料整理)
HTTP中的URL长度限制 首先,其实http 1.1 协议中对url的长度是不受限制的,协议原文: The HTTP protocol does not place any a priori l ...
- php数字转中文
function number2Chinese($num, $m = 1) { switch($m) { case 0: $CNum = array( array('零','壹','贰','叁','肆 ...
- _OBJC_CLASS_$_ errors 错误解决办法
步骤如下图: 1. 点击 Manage Schemes 2. Shared打对勾即可