zoukankan      html  css  js  c++  java
  • 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.04
    bash: 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 image for ubuntu:14.04
    [root@localhost ~]# docker image ls
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    ubuntu              14.04               2c5e00d77a67        7 weeks ago         188MB
    hello-world         latest              fce289e99eb9        6 months ago        1.84kB
    [root@localhost ~]#
  • 相关阅读:
    CXF入门案例
    计算python内部数据结构时间效率-源代码
    笨办法学习python-ex41源码加自己注释
    python之random模块
    python之模块、类、对象
    购物车代码
    ql的python学习之路-day1
    数组转置(函数指针,回调函数)
    将一句话按单词逆转
    *一个二级指针的练习(输入一个数,输出对应的月份)
  • 原文地址:https://www.cnblogs.com/laonicc/p/11142558.html
Copyright © 2011-2022 走看看