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 ...
随机推荐
- 白话JAVA守护线程
OneCoder(苦逼Coder)原创,转载请务必注明出处: http://www.coderli.com/archives/daemon-thread-plain-words/ 关于“白话”:偶然想 ...
- Android Service组件(1)
android service 和其他服务一样,并没有实际运行的界面,它运行在android 后台.一般通过service为应用程序提供服务(比如,从Internet下载文件,控制音乐播放器等).Se ...
- 经典 SQL
经典sql 总结一些经常用到或碰到的SQL语句,希望能与大家分享,同时也希望大家能提供更多的精妙SQL语句..... 1.delete table1 from (select * from tab ...
- HTML 5 JavaScript初步 编译运行.doc
编译运行 解释运行 JavaScript:只有一种变量类型,var.数据类型:整型,小数,字符串,布尔型 1.如何把数值型字符串变成数字型: parseInt("字符串")——把字 ...
- mysql学习(九)sql语句
SQL种类: DDL:数据定义语言 DML:数据操作语言 DQL:数据查询语言 DCL:数据控制语言 DDL: show databases; //查询数据库 create database if n ...
- Dict和Set类型
花括号{}表示这是一个dict,用于类似给定一个名字,就可以直接查找分数,d={} 由于dict也是集合,len()函数可以计算任何集合的大小 使用dict本身提供的get方法,当Key不存在时, ...
- unigui数据库连接池
UNIGUI for delphi,是一款WEB RIA开发框架.开发WEB程式如传统C/S般简单,众多DELPHIER趋之若鹜. 虽然上手非常容易,但要真正使用好,有些地方还是值得考究的. 网上有同 ...
- 使用Flex图表组件
原文 http://blog.csdn.net/mylxiaoyi/article/details/1618470 使用Flex图表组件 以图表或是图的方式显示数据的能力可以使得Flex程序用户的数据 ...
- Codeforces 734F Anton and School(位运算)
[题目链接] http://codeforces.com/problemset/problem/734/F [题目大意] 给出数列b和数列c,求数列a,如果不存在则输出-1 [题解] 我们发现: bi ...
- 经典排序算法(Java实现)
以下程序均将数据封装于DataWrap数据包装类中,如下所示: //数据包装类 class DataWrap implements Comparable<DataWrap> { int d ...