image 搜索docker_docker--image的获取

image有几种获取方式:

1、Docker官方提供了一种文件格式:Dockerfile,通过这种格式的文件,我们可以定义一个image,然后通过Dockerfile我们可以构建(build)一个image

2、通过registry拉去image

PS:registry 是docker提出的一个概念,有些像github,我们可以从github上 clone软件,也可以通过push把软件推到github上,供其他人使用,在docker里借鉴了这个概念,

我们可以通过registry拉取我们需要的image,也可以push到registry上面。

(1)docker hub 是docker免费提供的registry,我们用docker命令获取image 默认是docker hub(https://hub.docker.com/),如果是pull 拉取,不需要注册用户,如果要push则需要。

在docker hub上面可以search搜索有哪些image

(2)docker提供的image分两类,一种是docker官方提供的 带official images,另一种是个人提供的,比如Ubuntu image,有多个版本,通过docker pull ubuntu 则默认下载最新版本image,也可以通过tags,加上版本

(3)除了docker官方提供的image,还有第三方提供的image,通过pull获取时,需加上用户名比如

docker pull scrapybook/dev

取ubuntu14.04

[root@localhost ~]# doucker pull ubuntu:14.04bash: doucker: command not found...

Similar command is:'docker'[root@localhost~]# docker pull ubuntu:14.04

14.04: Pulling from library/ubuntu

a7344f52cb74: Pull complete

515c9bb51536: Pull complete

e1eabe0537eb: Pull complete

4701f1215c13: Pull complete

Digest: sha256:2f7c79927b346e436cc14c92bd4e5bd778c3bd7037f35bc639ac1589a7acfa90

Status: Downloaded newer imagefor ubuntu:14.04[root@localhost~]# docker image lsREPOSITORY TAG IMAGE ID CREATED SIZE

ubuntu14.04 2c5e00d77a67 7weeks ago 188MB

hello-world latest fce289e99eb9 6 months ago 1.84kB

[root@localhost~]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值