第 3 章 镜像 - 013 - Dockerfile 构建镜像
第一个 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:~#
- 当前目录为 /root
- 准备Dockerfile
- 运行 docker build 命令,
-t 指定
新镜像名ubuntu-with-vi-dockerfile
,命令末尾的.
指明 build context 为当前目录。Docker 默认会从 build context 中查找 Dockerfile 文件,我们也可以通过-f
参数指定 Dockerfile 的位置。 - 镜像真正的构建过程,Docker 将 build context 中的所有文件发送给 Docker daemon。build context 为镜像构建提供所需要的文件或目录。 Dockerfile 中的 ADD、COPY 等命令可以将 build context 中的文件添加到镜像。注:build context 为当前目录
/root
,该目录下的所有文件和子目录都会被发送给 Docker daemon。所以不要将多余文件放到 build context,特别不要把/
、/usr
作为 build context,否则构建过程会相当缓慢甚至失败。 - Step 1:执行
FROM
,将 ubuntu 作为 base 镜像。 - Step 2:执行
RUN
,安装 vim。 - 启动临时容器(1ffb347c507f),在容器中通过 apt-get 安装 vim。
- 安装成功后,将容器保存为镜像。这一步底层使用的是类似 docker commit 的命令。
- 删除临时容器 9f4d4166f7e3。
- 镜像构建成功。 通过 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 构建镜像的更多相关文章
- 013、Dockerfile构建镜像(2019-01-02 周三)
参考https://www.cnblogs.com/CloudMan6/p/6830067.html Dockerfile构建镜像过程分析 root@docker-lab:~/111# ls ...
- 使用Dockerfile构建镜像-Docker for Web Developers(5)
1.理解Dockerfile语法 语法命令 命令功能 举例 FROM 所有的dockerfile都必须以FROM命令指定镜像基于哪个基础镜像来制作 FROM ubuntu:14:04 MAINTAIN ...
- Docker容器学习梳理 - Dockerfile构建镜像
在Docker的运用中,从下载镜像,启动容器,在容器中输入命令来运行程序,这些命令都是手工一条条往里输入的,无法重复利用,而且效率很低.所以就需要一 种文件或脚本,我们把想执行的操作以命令的方式写入其 ...
- Dockerfile构建镜像
Dockerfile构建镜像的步骤: 从基础镜像运行一个容器 执行一条指令,对容器做出修改 执行类似docker commit的操作,提交一个新的镜像层 再基于刚提交的镜像运行一个新的容器 执行Doc ...
- Dockerfile 构建镜像
一.使用dockerfile构建镜像 基本结构: a.设置基础镜像 当前镜像继承于的基础镜像 FROM centos:latest b.设置维护者信息 没有固定格式 c.设置需要添加到容器中的文件 ...
- Dockerfile构建镜像实战
目录 一.常见Dockerfile指令 二.编写Centos Dockerfile 2.1.编写Dockerfile 2.2.构建 2.3.查看Docker镜像 2.4.运行镜像 三.CMD和ENTR ...
- docker:(2)通过Dockerfile构建镜像并发布web项目
上一篇讲解了docker的基本使用 http://www.cnblogs.com/xiaochangwei/p/8204511.html 虽然通过修改获取到的镜像可以达到使用目的,但是多操作几次就会发 ...
- Dockerfile 构建镜像 - 每天5分钟玩转容器技术(13)
Dockerfile 是一个文本文件,记录了镜像构建的所有步骤. 第一个 Dockerfile 用 Dockerfile 创建上节的 ubuntu-with-vi,其内容则为: 下面我们运行 dock ...
- docker(四) 使用Dockerfile构建镜像
下面以一个例子来演示构建镜像的过程. #在/tmp目录下演示 cd tmp mkdir build-redis-image 1.创建Dockerfile文件 vim Dockerfile 并写入如下内 ...
随机推荐
- libvirt的security
1. libvirt支持SASL authentication and encryption MD5 hashes are considered unsafe and should not be us ...
- android官方开发教程解释(一)
最近准备系统学一下android开发,这里不会照搬原文,只会针对教程中一些难以理解的部分进行解释,我只是个菜鸟. 在教程第一章——入门基础里面,讲解android主题的那个小节,大概会有以下的代码: ...
- Bootstrap3基础 input-group glyphicon 输入框组与glyphicon图标
内容 参数 OS Windows 10 x64 browser Firefox 65.0.2 framework Bootstrap 3.3.7 editor ...
- Cygwin、MinG、MSys区别与联系(转)
转自:https://www.biaodianfu.com/cygwin-ming-msys.html 什么是Cygwin? Cygwin,原Cygnus出品(已被红帽收购),目前是RedHat名下的 ...
- 再谈 tp的 实例化 类 的自动加载
表示一个域名下的所有/任何主机 使用 的格式是: [*.] example.com 其中 , example.com叫着 裸域名. (这个example.com/net/org不能被注册, 被保留) ...
- Elasticsearch-->Get Started--> Exploring Your Data
Exploring Your Data Sample Dataset Now that we’ve gotten a glimpse of the basics, let’s try to work ...
- OpenWRT路由器使用ipv6拨号上网教程
文章来源于群友,如有侵权,请联系我(aha971030@gmail.com)删除 原理介绍分析: 湖北E信地区可以使用ipv6拨号,好处是网络是上下对等不限速网络,也就是说,你的端口上限是多少,网上就 ...
- 集合05_Collections工具类
Collections工具类 提供大量方法用于操作集合,比如排序,查找,替换 同步控制 提供synchronizedXxx()方法将指定集合类包装成线程同步的集合. List<String> ...
- (zhuan) Evolution Strategies as a Scalable Alternative to Reinforcement Learning
Evolution Strategies as a Scalable Alternative to Reinforcement Learning this blog from: https://blo ...
- 【C#】委托中的匿名函数与lambda
将方法作为方法的参数 委托是一个类,它定义了方法的类型,使得可以将方法当作另一个方法的参数来进行传递,这种将方法动态地赋给参数的做法,可以避免在程序中大量使用If-Else(Switch)语句,同时使 ...