第一个 Dockerfile

 FROM ubuntu
RUN apt-get update && apt-get install -y vim

运行 docker build 命令构建镜像并详细分析每个细节

 root@ubuntu:~# pwd
/root
root@ubuntu:~#
root@ubuntu:~# cat Dockerfile
FROM ubuntu
RUN apt-get update && apt-get install -y vim
root@ubuntu:~#
root@ubuntu:~# docker build -t ubuntu-with-vi-dockerfile .
Sending build context to Docker daemon .06kB
Step / : FROM ubuntu
---> 1d9c17228a9e
Step / : RUN apt-get update && apt-get install -y vim
---> Running in 1ffb347c507f
Get: http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Get: http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get: http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [1367 B]
Get: http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [135 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get: http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [300 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get: http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [10.7 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [6931 B]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [900 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [618 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [3655 B]
Fetched 15.3 MB in 48s ( kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
file libexpat1 libgpm2 libmagic-mgc libmagic1 libmpdec2 libpython3.
libpython3.-minimal libpython3.-stdlib libreadline7 libsqlite3- libssl1.
mime-support readline-common vim-common vim-runtime xxd xz-utils
Suggested packages:
gpm readline-doc ctags vim-doc vim-scripts
The following NEW packages will be installed:
file libexpat1 libgpm2 libmagic-mgc libmagic1 libmpdec2 libpython3.
libpython3.-minimal libpython3.-stdlib libreadline7 libsqlite3- libssl1.
mime-support readline-common vim vim-common vim-runtime xxd xz-utils
upgraded, newly installed, to remove and not upgraded.
Need to get 12.7 MB of archives.
After this operation, 61.0 MB of additional disk space will be used.
Get: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmagic-mgc amd64 1:5.32-2ubuntu0.1 [184 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmagic1 amd64 1:5.32-2ubuntu0.1 [68.4 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 file amd64 1:5.32-2ubuntu0.1 [22.1 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 libexpat1 amd64 2.2.5-3 [80.2 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 libmpdec2 amd64 2.4.2-1ubuntu1 [84.1 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.1 amd64 1.1.0g-2ubuntu4.3 [1130 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-minimal amd64 3.6.7-1~18.04 [531 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 mime-support all 3.60ubuntu1 [30.1 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 readline-common all 7.0-3 [52.9 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 libreadline7 amd64 7.0-3 [124 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 libsqlite3-0 amd64 3.22.0-1 [496 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6-stdlib amd64 3.6.7-1~18.04 [1711 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 xxd amd64 2:8.0.1453-1ubuntu1 [49.2 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 vim-common all 2:8.0.1453-1ubuntu1 [70.4 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 xz-utils amd64 5.2.2-1.3 [83.8 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 libgpm2 amd64 1.20.7-5 [15.1 kB]
Get: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython3.6 amd64 3.6.7-1~18.04 [1415 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 vim-runtime all 2:8.0.1453-1ubuntu1 [5437 kB]
Get: http://archive.ubuntu.com/ubuntu bionic/main amd64 vim amd64 2:8.0.1453-1ubuntu1 [1152 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 12.7 MB in 38s ( kB/s)
Selecting previously unselected package libmagic-mgc.
(Reading database ... files and directories currently installed.)
Preparing to unpack .../-libmagic-mgc_1%3a5.-2ubuntu0.1_amd64.deb ...
Unpacking libmagic-mgc (:5.32-2ubuntu0.) ...
Selecting previously unselected package libmagic1:amd64.
Preparing to unpack .../-libmagic1_1%3a5.-2ubuntu0.1_amd64.deb ...
Unpacking libmagic1:amd64 (:5.32-2ubuntu0.) ...
Selecting previously unselected package file.
Preparing to unpack .../-file_1%3a5.-2ubuntu0.1_amd64.deb ...
Unpacking file (:5.32-2ubuntu0.) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../-libexpat1_2.2.5-3_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.-) ...
Selecting previously unselected package libmpdec2:amd64.
Preparing to unpack .../-libmpdec2_2.4.2-1ubuntu1_amd64.deb ...
Unpacking libmpdec2:amd64 (2.4.-1ubuntu1) ...
Selecting previously unselected package libssl1.:amd64.
Preparing to unpack .../-libssl1.1_1..0g-2ubuntu4.3_amd64.deb ...
Unpacking libssl1.:amd64 (1.1.0g-2ubuntu4.) ...
Selecting previously unselected package libpython3.-minimal:amd64.
Preparing to unpack .../-libpython3.-minimal_3.6.7-~.04_amd64.deb ...
Unpacking libpython3.-minimal:amd64 (3.6.-~18.04) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../-mime-support_3.60ubuntu1_all.deb ...
Unpacking mime-support (.60ubuntu1) ...
Selecting previously unselected package readline-common.
Preparing to unpack .../-readline-common_7.-3_all.deb ...
Unpacking readline-common (7.0-) ...
Selecting previously unselected package libreadline7:amd64.
Preparing to unpack .../-libreadline7_7.-3_amd64.deb ...
Unpacking libreadline7:amd64 (7.0-) ...
Selecting previously unselected package libsqlite3-:amd64.
Preparing to unpack .../-libsqlite3-0_3.22.0-1_amd64.deb ...
Unpacking libsqlite3-:amd64 (3.22.-) ...
Selecting previously unselected package libpython3.-stdlib:amd64.
Preparing to unpack .../-libpython3.-stdlib_3.6.7-~.04_amd64.deb ...
Unpacking libpython3.-stdlib:amd64 (3.6.-~18.04) ...
Selecting previously unselected package xxd.
Preparing to unpack .../-xxd_2%3a8.0.1453-1ubuntu1_amd64.deb ...
Unpacking xxd (:8.0.-1ubuntu1) ...
Selecting previously unselected package vim-common.
Preparing to unpack .../-vim-common_2%3a8.0.1453-1ubuntu1_all.deb ...
Unpacking vim-common (:8.0.-1ubuntu1) ...
Selecting previously unselected package xz-utils.
Preparing to unpack .../-xz-utils_5.2.2-.3_amd64.deb ...
Unpacking xz-utils (5.2.-1.3) ...
Selecting previously unselected package libgpm2:amd64.
Preparing to unpack .../-libgpm2_1.20.7-5_amd64.deb ...
Unpacking libgpm2:amd64 (1.20.-) ...
Selecting previously unselected package libpython3.:amd64.
Preparing to unpack .../-libpython3.6_3.6.7-~.04_amd64.deb ...
Unpacking libpython3.:amd64 (3.6.-~18.04) ...
Selecting previously unselected package vim-runtime.
Preparing to unpack .../-vim-runtime_2%3a8.0.1453-1ubuntu1_all.deb ...
Adding 'diversion of /usr/share/vim/vim80/doc/help.txt to /usr/share/vim/vim80/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim80/doc/tags to /usr/share/vim/vim80/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (:8.0.-1ubuntu1) ...
Selecting previously unselected package vim.
Preparing to unpack .../-vim_2%3a8.0.1453-1ubuntu1_amd64.deb ...
Unpacking vim (:8.0.-1ubuntu1) ...
Setting up readline-common (7.0-) ...
Setting up libexpat1:amd64 (2.2.-) ...
Setting up mime-support (.60ubuntu1) ...
Setting up xxd (:8.0.-1ubuntu1) ...
Setting up libgpm2:amd64 (1.20.-) ...
Setting up libreadline7:amd64 (7.0-) ...
Setting up libmagic-mgc (:5.32-2ubuntu0.) ...
Setting up libmagic1:amd64 (:5.32-2ubuntu0.) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libssl1.:amd64 (1.1.0g-2ubuntu4.) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Setting up xz-utils (5.2.-1.3) ...
update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/man1/lzma..gz because associated file /usr/share/man/man1/xz..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma..gz because associated file /usr/share/man/man1/unxz..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat..gz because associated file /usr/share/man/man1/xzcat..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore..gz because associated file /usr/share/man/man1/xzmore..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzless..gz because associated file /usr/share/man/man1/xzless..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff..gz because associated file /usr/share/man/man1/xzdiff..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp..gz because associated file /usr/share/man/man1/xzcmp..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep..gz because associated file /usr/share/man/man1/xzgrep..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep..gz because associated file /usr/share/man/man1/xzegrep..gz (of link group lzma) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep..gz because associated file /usr/share/man/man1/xzfgrep..gz (of link group lzma) doesn't exist
Setting up vim-common (:8.0.-1ubuntu1) ...
Setting up libsqlite3-:amd64 (3.22.-) ...
Setting up vim-runtime (:8.0.-1ubuntu1) ...
Setting up libmpdec2:amd64 (2.4.-1ubuntu1) ...
Setting up file (:5.32-2ubuntu0.) ...
Setting up libpython3.-minimal:amd64 (3.6.-~18.04) ...
Setting up libpython3.-stdlib:amd64 (3.6.-~18.04) ...
Setting up libpython3.:amd64 (3.6.-~18.04) ...
Setting up vim (:8.0.-1ubuntu1) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/fr/man1/vi..gz because associated file /usr/share/man/fr/man1/vim..gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/it/man1/vi..gz because associated file /usr/share/man/it/man1/vim..gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/pl/man1/vi..gz because associated file /usr/share/man/pl/man1/vim..gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ru/man1/vi..gz because associated file /usr/share/man/ru/man1/vim..gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ja/man1/vi..gz because associated file /usr/share/man/ja/man1/vim..gz (of link group vi) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/vi..gz because associated file /usr/share/man/man1/vim..gz (of link group vi) doesn't exist
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/fr/man1/view..gz because associated file /usr/share/man/fr/man1/vim..gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/it/man1/view..gz because associated file /usr/share/man/it/man1/vim..gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/pl/man1/view..gz because associated file /usr/share/man/pl/man1/vim..gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ru/man1/view..gz because associated file /usr/share/man/ru/man1/vim..gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ja/man1/view..gz because associated file /usr/share/man/ja/man1/vim..gz (of link group view) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/view..gz because associated file /usr/share/man/man1/vim..gz (of link group view) doesn't exist
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/fr/man1/ex..gz because associated file /usr/share/man/fr/man1/vim..gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/it/man1/ex..gz because associated file /usr/share/man/it/man1/vim..gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/pl/man1/ex..gz because associated file /usr/share/man/pl/man1/vim..gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ru/man1/ex..gz because associated file /usr/share/man/ru/man1/vim..gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ja/man1/ex..gz because associated file /usr/share/man/ja/man1/vim..gz (of link group ex) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/ex..gz because associated file /usr/share/man/man1/vim..gz (of link group ex) doesn't exist
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode
update-alternatives: warning: skip creation of /usr/share/man/fr/man1/editor..gz because associated file /usr/share/man/fr/man1/vim..gz (of link group editor) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/it/man1/editor..gz because associated file /usr/share/man/it/man1/vim..gz (of link group editor) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/pl/man1/editor..gz because associated file /usr/share/man/pl/man1/vim..gz (of link group editor) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ru/man1/editor..gz because associated file /usr/share/man/ru/man1/vim..gz (of link group editor) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/ja/man1/editor..gz because associated file /usr/share/man/ja/man1/vim..gz (of link group editor) doesn't exist
update-alternatives: warning: skip creation of /usr/share/man/man1/editor..gz because associated file /usr/share/man/man1/vim..gz (of link group editor) doesn't exist
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Removing intermediate container 1ffb347c507f
---> 1e996ab06bb9
Successfully built 1e996ab06bb9
Successfully tagged ubuntu-with-vi-dockerfile:latest
root@ubuntu:~#
root@ubuntu:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-with-vi-dockerfile latest 1e996ab06bb9 minutes ago 170MB
ubuntu-with-vi latest b5410dfa9a42 days ago 170MB
ubuntu latest 1d9c17228a9e days ago .7MB
root@ubuntu:~#
  1. 当前目录为 /root
  2. 准备Dockerfile
  3. 运行 docker build 命令,-t 指定新镜像名ubuntu-with-vi-dockerfile,命令末尾的 . 指明 build context 为当前目录。Docker 默认会从 build context 中查找 Dockerfile 文件,我们也可以通过 -f 参数指定 Dockerfile 的位置。
  4. 镜像真正的构建过程,Docker 将 build context 中的所有文件发送给 Docker daemon。build context 为镜像构建提供所需要的文件或目录。 Dockerfile 中的 ADD、COPY 等命令可以将 build context 中的文件添加到镜像。注:build context 为当前目录 /root,该目录下的所有文件和子目录都会被发送给 Docker daemon。所以不要将多余文件放到 build context,特别不要把 //usr 作为 build context,否则构建过程会相当缓慢甚至失败。
  5. Step 1:执行 FROM,将 ubuntu 作为 base 镜像。
  6. Step 2:执行 RUN,安装 vim。
  7. 启动临时容器(1ffb347c507f),在容器中通过 apt-get 安装 vim。
  8. 安装成功后,将容器保存为镜像。这一步底层使用的是类似 docker commit 的命令。
  9. 删除临时容器 9f4d4166f7e3。
  10. 镜像构建成功。 通过 docker images 查看镜像信息

镜像的构建历史

docker history 会显示镜像的构建历史,也就是 Dockerfile 的执行过程。

 root@ubuntu:~# docker history ubuntu
IMAGE CREATED CREATED BY SIZE COMMENT
1d9c17228a9e days ago /bin/sh -c #(nop) CMD ["/bin/bash"] 0B
<missing> days ago /bin/sh -c mkdir -p /run/systemd && echo 'do… 7B
<missing> days ago /bin/sh -c rm -rf /var/lib/apt/lists/* 0B
<missing> 5 days ago /bin/sh -c set -xe && echo '#!/bin/sh' > /… 745B
<missing> 5 days ago /bin/sh -c #(nop) ADD file:c0f17c7189fc11b6a… 86.7MB
root@ubuntu:~# docker history ubuntu-with-vi-dockerfile:latest
IMAGE CREATED CREATED BY SIZE COMMENT
1e996ab06bb9 25 minutes ago /bin/sh -c apt-get update && apt-get install… 83.8MB
1d9c17228a9e 5 days ago /bin/sh -c #(nop) CMD ["/bin/bash"] 0B
<missing> 5 days ago /bin/sh -c mkdir -p /run/systemd && echo 'do… 7B
<missing> 5 days ago /bin/sh -c rm -rf /var/lib/apt/lists/* 0B
<missing> 5 days ago /bin/sh -c set -xe && echo '#!/bin/sh' > /… 745B
<missing> 5 days ago /bin/sh -c #(nop) ADD file:c0f17c7189fc11b6a… 86.7MB
root@ubuntu:~#

这个新镜像层的内容由 RUN apt-get update && apt-get install -y vim 生成。

------------引用来自------------

https://mp.weixin.qq.com/s?__biz=MzIwMTM5MjUwMg==&mid=2653587598&idx=1&sn=d0952497b3a2272eee05cfb1e4e05e62&chksm=8d308097ba47098189b45ba63c4040cf94d687fb19c54b9cab593df9995612ce0b0632e9a54e&scene=21#wechat_redirect

第 3 章 镜像 - 013 - Dockerfile 构建镜像的更多相关文章

  1. 013、Dockerfile构建镜像(2019-01-02 周三)

    参考https://www.cnblogs.com/CloudMan6/p/6830067.html   Dockerfile构建镜像过程分析   root@docker-lab:~/111# ls  ...

  2. 使用Dockerfile构建镜像-Docker for Web Developers(5)

    1.理解Dockerfile语法 语法命令 命令功能 举例 FROM 所有的dockerfile都必须以FROM命令指定镜像基于哪个基础镜像来制作 FROM ubuntu:14:04 MAINTAIN ...

  3. Docker容器学习梳理 - Dockerfile构建镜像

    在Docker的运用中,从下载镜像,启动容器,在容器中输入命令来运行程序,这些命令都是手工一条条往里输入的,无法重复利用,而且效率很低.所以就需要一 种文件或脚本,我们把想执行的操作以命令的方式写入其 ...

  4. Dockerfile构建镜像

    Dockerfile构建镜像的步骤: 从基础镜像运行一个容器 执行一条指令,对容器做出修改 执行类似docker commit的操作,提交一个新的镜像层 再基于刚提交的镜像运行一个新的容器 执行Doc ...

  5. Dockerfile 构建镜像

    一.使用dockerfile构建镜像 基本结构: a.设置基础镜像 当前镜像继承于的基础镜像 FROM centos:latest  b.设置维护者信息 没有固定格式  c.设置需要添加到容器中的文件 ...

  6. Dockerfile构建镜像实战

    目录 一.常见Dockerfile指令 二.编写Centos Dockerfile 2.1.编写Dockerfile 2.2.构建 2.3.查看Docker镜像 2.4.运行镜像 三.CMD和ENTR ...

  7. docker:(2)通过Dockerfile构建镜像并发布web项目

    上一篇讲解了docker的基本使用 http://www.cnblogs.com/xiaochangwei/p/8204511.html 虽然通过修改获取到的镜像可以达到使用目的,但是多操作几次就会发 ...

  8. Dockerfile 构建镜像 - 每天5分钟玩转容器技术(13)

    Dockerfile 是一个文本文件,记录了镜像构建的所有步骤. 第一个 Dockerfile 用 Dockerfile 创建上节的 ubuntu-with-vi,其内容则为: 下面我们运行 dock ...

  9. docker(四) 使用Dockerfile构建镜像

    下面以一个例子来演示构建镜像的过程. #在/tmp目录下演示 cd tmp mkdir build-redis-image 1.创建Dockerfile文件 vim Dockerfile 并写入如下内 ...

随机推荐

  1. 树莓派安装cobbler,自动化安装CentOS

    安装python.相关python模块.apache sudo apt-get install python python2.7 python-django python-netaddr python ...

  2. ORA-00600: internal error code, arguments: [13030], [20]一例解决

    两年没有接触oracle了,中午,一环境update from的时候出现ORA-00600: internal error code, arguments: [13030], [20]异常,经查,官网 ...

  3. 【题解】 Luogu CF375D Tree and Queries

    原题传送门 这道题要用树链剖分,我博客里有对树链剖分的详细介绍 我博客中对莫队的详细介绍 莫队好题 我一上来想写线段树,随后觉得不好写并弃坑 我们可以看见没有修改操作,钦定莫队 但这是在树上,所以不能 ...

  4. 【题解】Luogu CF1051F The Shortest Statement

    原题传送门:CF1051F The Shortest Statement 题目大意,给你一个稀疏图,q次查询,查询两点之间距离 边数减点小于等于20 这不是弱智题吗,23forever dalao又开 ...

  5. Iris Classification on PyTorch

    Iris Classification on PyTorch code # -*- coding:utf8 -*- from sklearn.datasets import load_iris fro ...

  6. vfio

    VFIO简介 Documentation/vfio.txt 还是不理解IOMMU.北桥.PCI的MMIO和ioremap file:///C:/Users/shaohefe/Downloads/vt- ...

  7. forever 用法

    安装过Node.js后再安装forever,需要加-g参数,因为forever要求安装到全局环境下: npm install forever -g 常用指令: npm install forever ...

  8. NodeJs中npm使用

    什么是 NPM npm 之于 Node ,就像 pip 之于 Python , gem 之于 Ruby , pear 之于 PHP . npm 是 Node 官方提供的包管理工具,他已经成了 Node ...

  9. SQL优化参考

    1.对查询进行优化,要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索 ...

  10. it做形式主语的句子

    1. it was considerate of you to visit my mother every day and (to) bring me your notes to help me wi ...