成人无码视频,亚洲精品久久久久av无码,午夜精品久久久久久毛片,亚洲 中文字幕 日韩 无码

資訊專欄INFORMATION COLUMN

Working with Docker Images

wangxinarhat / 2158人閱讀

摘要:注意上述命令有個(gè)用來指定文件的位置給鏡像添加標(biāo)簽需要登錄賬號(hào)總結(jié)查看鏡像查找鏡像這條命令很重要和難記,和的作用類似,指定作者指更改過的的,是新的的名字后面要指定的地址

目標(biāo)

本地主機(jī)管理鏡像

創(chuàng)建自己的鏡像

上傳鏡像到Docker Hub registry

Listing images on the host
  

列出主機(jī)的鏡像

shelladolph@geek:~$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu              14.04               07f8e8c5e660        12 days ago         188.3 MB
hello-world         latest              91c95931e552        3 weeks ago         910 B
training/webapp     latest              31fa814ba25a        11 months ago       278.8 MB

鏡像來自的倉庫,標(biāo)簽和Id這些信息都很重要,來自相同的倉庫我們通過標(biāo)簽來指定要運(yùn)行的鏡像

languagedocker run -i -t ubuntu:14.04 /bin/bash
docker run -i -t ubuntu:latest /bin/bash     (不加標(biāo)簽?zāi)J(rèn)是`latest`)
  

個(gè)人覺得標(biāo)簽的好處是對(duì)于來自相同的倉庫通過標(biāo)簽來告訴docker我要運(yùn)行的是哪個(gè)鏡像

Finding images
  

尋找鏡像

languagedocker search [image name]
docker pull [image name]...找到合適的后直接拉下來
Creating our own images
  

創(chuàng)建和定制自己的鏡像

更改現(xiàn)有鏡像并提交(保存)

使用Dockerfile來制作鏡像

Updating and committing an image
languagedocker run -i -t ubuntu:14.04 /bin/bash
root@5bc673e32e0a:/#apt-get install git
root@5bc673e32e0a:/#exit
sudo docker commit -m "install git" -a "adolph" 0b2616b0e5a8 adolph/ubuntu:14.04

output:4f177bd27a9ff0f6dc2a830403925b5360bfe0b93d476f7fc3231110e7f71b1c
Building an image from a Dockerfile
languagemkdir ubuntu
cd ubuntu
touch Dockerfile
vim Dockerfile
content:

#this is my fiest image created by dockerfile
FROM ubuntu:14.04
MAINTAINER adolph 
RUN apt-get update
#RUN apt-get install git

結(jié)果:

languageadolph@geek:~/ubuntu$ sudo docker build -t adolph-dockerfile/ubuntu:14.04 .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon 
Step 0 : FROM ubuntu:14.04
 ---> 07f8e8c5e660
Step 1 : MAINTAINER adolph 
 ---> Running in 241ad7c398c3
 ---> 10d866905c1a
Removing intermediate container 241ad7c398c3
Step 2 : RUN apt-get update
 ---> Running in 826db7ff28e6
Ign http://archive.ubuntu.com trusty InRelease
Ign http://archive.ubuntu.com trusty-updates InRelease
。。。。。。。。。

sudo docker build -t adolph-dockerfile/ubuntu:14.04 .

注意上述命令有個(gè).用來指定Dockerfile文件的位置

Setting tags on an image
  

給鏡像添加標(biāo)簽

languagedocker tag [image id] [username]/[repository]:[tag name]
Push an image to Docker Hub
  

需要登錄Docker Hub賬號(hào)

docker push [image name]

Remove an image from the host

docker rmi [image name]

總結(jié)
languagedocker images...查看docker鏡像
docker search [images name]...查找鏡像

sudo docker commit -m "install git" -a "adolph" 0b2616b0e5a8(old image id) adolph/ubuntu:14.04(new image name with tag 14.04)
這條命令很重要和難記,-mgit commit -m的作用類似,-a指定作者,id指更改過的image的idadolph/ubuntu是新的image的名字

languagedocker build -t adolph-dockerfile/ubuntu:14.04 .
后面要指定dockerfile的地址
docker tag [image id] [username]/[repository]:[tag name]
docker push [image name]
docker rmi [image name]

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://m.hztianpu.com/yun/26389.html

相關(guān)文章

  • Working with Docker Hub

    摘要:到目前為止我們已經(jīng)學(xué)習(xí)了如何使用命令行在主機(jī)上運(yùn)行。是由公司維護(hù)的公共注冊倉庫。其中有兩個(gè)結(jié)果,。第二個(gè)表示它來自于一位叫的用戶的倉庫。第一個(gè)結(jié)果沒有顯示列出倉庫則意味著它是受信任的官方頂級(jí)名稱空間存儲(chǔ)庫。將倉庫名和鏡像名分割開。 Working with Docker Hub 到目前為止我們已經(jīng)學(xué)習(xí)了如何使用命令行在主機(jī)上運(yùn)行Docker。你已經(jīng)學(xué)習(xí)了如何下載鏡像,如何從已經(jīng)存在的鏡...

    Charles 評(píng)論0 收藏0
  • Working with Containers

    摘要:先回顧之前學(xué)習(xí)過的一些命令交互式運(yùn)行運(yùn)行守護(hù)進(jìn)程容器列表顯示容器的標(biāo)準(zhǔn)輸出命令格式能干什么顯示后能執(zhí)行的命令命令使用查看特定命令的使用方式中運(yùn)行一個(gè)應(yīng)用參數(shù)表示將容器內(nèi)部要用到的網(wǎng)絡(luò)端口映射到主機(jī)顯示容器的詳細(xì)信 showImg(http://7vihfm.com1.z0.glb.clouddn.com/2015-3-28-weekly-summary.jpeg); 先回顧之前學(xué)習(xí)過...

    codecraft 評(píng)論0 收藏0
  • 走進(jìn)docker(03):如何繞過docker運(yùn)行hello-world?

    摘要:相關(guān)工具本文將用到三個(gè)工具,分別是和。根據(jù)生成的的就是運(yùn)行容器時(shí)需要的東西的集合。使用運(yùn)行該有了后,就可以用來運(yùn)行該容器了這里直接用的代替命令,如果你自己編譯了的,那么用命令也是一樣的。 上一篇介紹了image的格式,這里我們就來用一下hello-world這個(gè)image,看怎么輸出和docker run hello-world同樣的內(nèi)容。 相關(guān)工具 本文將用到三個(gè)工具,分別是skop...

    robin 評(píng)論0 收藏0
  • Deploy Django Project of local MySQL DB using Dock

    摘要: Docker in Windows Normally, those kinds of things will be much more troublesome when you want to run them in Windows compare to in Linux. However, Docker has made quite user-friendly for Window...

    Juven 評(píng)論0 收藏0
  • Deploy Django Project of local MySQL DB using Dock

    摘要: Docker in Windows Normally, those kinds of things will be much more troublesome when you want to run them in Windows compare to in Linux. However, Docker has made quite user-friendly for Window...

    Keagan 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

閱讀需要支付1元查看
<