3-2 dockerfile实战

3-2 dockerfile实战

Xshell 5 (Build 0537)
Copyright (c) 2002-2014 NetSarang Computer, Inc. All rights reserved.

Type `help' to learn how to use Xshell prompt.
[c:\~]$ 

Connecting to 118.31.36.138:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-135-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch
New release '20.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Welcome to Alibaba Cloud Elastic Compute Service !

Last login: Mon Mar 22 18:58:09 2021 from 116.233.210.70
root@iZbp1berl2oy3e3vt5476fZ:~# mkdir dockerfiler2
root@iZbp1berl2oy3e3vt5476fZ:~# cd dockerfiler2/
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# ls
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# touch Dockerfile
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# vim Dockerfile 
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# vim Dockerfile 
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# touch index.html
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# vim index.html 
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# docker build -t root/hello-nginx .
Sending build context to Docker daemon  3.072kB
Step 1/8 : FROM ubuntu
 ---> 4dd97cefde62
Step 2/8 : MAINTAINER root
 ---> Running in ea127174bec9
Removing intermediate container ea127174bec9
 ---> 9700653523ef
Step 3/8 : RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
 ---> Running in c1414cc96535
Removing intermediate container c1414cc96535
 ---> 1cf05a30e8c9
Step 4/8 : RUN apt-get update
 ---> Running in f43a0730e577
Get:1 http://mirrors.ustc.edu.cn/ubuntu focal InRelease [265 kB]
Get:2 http://mirrors.ustc.edu.cn/ubuntu focal-updates InRelease [114 kB]
Get:3 http://mirrors.ustc.edu.cn/ubuntu focal-backports InRelease [101 kB]
Get:4 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 Packages [1275 kB]
Get:5 http://mirrors.ustc.edu.cn/ubuntu focal/multiverse amd64 Packages [177 kB]
Get:6 http://mirrors.ustc.edu.cn/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:7 http://mirrors.ustc.edu.cn/ubuntu focal/universe amd64 Packages [11.3 MB]
Get:8 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:9 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 Packages [1093 kB]
Get:10 http://mirrors.ustc.edu.cn/ubuntu focal-updates/multiverse amd64 Packages [29.6 kB]
Get:11 http://mirrors.ustc.edu.cn/ubuntu focal-updates/universe amd64 Packages [940 kB]
Get:12 http://mirrors.ustc.edu.cn/ubuntu focal-updates/restricted amd64 Packages [220 kB]
Get:13 http://mirrors.ustc.edu.cn/ubuntu focal-backports/universe amd64 Packages [4305 B]
Get:14 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [21.6 kB]
Get:15 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [187 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [689 kB]
Get:17 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [681 kB]
Fetched 17.3 MB in 15s (1157 kB/s)
Reading package lists...
Removing intermediate container f43a0730e577
 ---> 1dc2445aee7d
Step 5/8 : RUN apt-get install -y nginx
 ---> Running in c3a0d19aa12d
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core iproute2 libatm1 libbsd0 libcap2
  libcap2-bin libelf1 libexpat1 libfontconfig1 libfreetype6 libgd3 libicu66
  libjbig0 libjpeg-turbo8 libjpeg8 libmnl0 libnginx-mod-http-image-filter
  libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream
  libpam-cap libpng16-16 libssl1.1 libtiff5 libwebp6 libx11-6 libx11-data
  libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxslt1.1 libxtables12
  nginx-common nginx-core tzdata ucf
Suggested packages:
  iproute2-doc libgd-tools fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core iproute2 libatm1 libbsd0 libcap2
  libcap2-bin libelf1 libexpat1 libfontconfig1 libfreetype6 libgd3 libicu66
  libjbig0 libjpeg-turbo8 libjpeg8 libmnl0 libnginx-mod-http-image-filter
  libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream
  libpam-cap libpng16-16 libssl1.1 libtiff5 libwebp6 libx11-6 libx11-data
  libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxslt1.1 libxtables12 nginx
  nginx-common nginx-core tzdata ucf
0 upgraded, 40 newly installed, 0 to remove and 3 not upgraded.
Need to get 15.8 MB of archives.
After this operation, 60.8 MB of additional disk space will be used.
Get:1 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libbsd0 amd64 0.10.0-1 [45.4 kB]
Get:2 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libcap2 amd64 1:2.32-1 [15.9 kB]
Get:3 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libelf1 amd64 0.176-1.1build1 [44.0 kB]
Get:4 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libmnl0 amd64 1.0.4-2 [12.3 kB]
Get:5 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libxtables12 amd64 1.8.4-3ubuntu2 [28.4 kB]
Get:6 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libcap2-bin amd64 1:2.32-1 [26.2 kB]
Get:7 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 iproute2 amd64 5.5.0-1ubuntu1 [858 kB]
Get:8 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libatm1 amd64 1:2.5.1-4 [21.8 kB]
Get:9 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libexpat1 amd64 2.2.9-1build1 [73.3 kB]
Get:10 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 tzdata all 2021a-0ubuntu0.20.04 [295 kB]
Get:11 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libicu66 amd64 66.1-2ubuntu2 [8520 kB]
Get:12 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libpam-cap amd64 1:2.32-1 [8352 B]
Get:13 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libssl1.1 amd64 1.1.1f-1ubuntu2.2 [1319 kB]
Get:14 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libxml2 amd64 2.9.10+dfsg-5 [640 kB]
Get:15 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 ucf all 3.0038+nmu1 [51.6 kB]
Get:16 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libpng16-16 amd64 1.6.37-2 [179 kB]
Get:17 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libxau6 amd64 1:1.0.9-0ubuntu1 [7488 B]
Get:18 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libxdmcp6 amd64 1:1.1.3-0ubuntu1 [10.6 kB]
Get:19 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libxcb1 amd64 1.14-2 [44.7 kB]
Get:20 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libx11-data all 2:1.6.9-2ubuntu1.1 [113 kB]
Get:21 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libx11-6 amd64 2:1.6.9-2ubuntu1.1 [574 kB]
Get:22 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 fonts-dejavu-core all 2.37-1 [1041 kB]
Get:23 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 fontconfig-config all 2.13.1-2ubuntu3 [28.8 kB]
Get:24 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libfreetype6 amd64 2.10.1-2ubuntu0.1 [341 kB]
Get:25 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libfontconfig1 amd64 2.13.1-2ubuntu3 [114 kB]
Get:26 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libjpeg-turbo8 amd64 2.0.3-0ubuntu1.20.04.1 [117 kB]
Get:27 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2194 B]
Get:28 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libjbig0 amd64 2.1-3.1build1 [26.7 kB]
Get:29 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libwebp6 amd64 0.6.1-2 [185 kB]
Get:30 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libtiff5 amd64 4.1.0+git191117-2ubuntu0.20.04.1 [162 kB]
Get:31 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libxpm4 amd64 1:3.5.12-1 [34.0 kB]
Get:32 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libgd3 amd64 2.2.5-5.2ubuntu2 [118 kB]
Get:33 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 nginx-common all 1.18.0-0ubuntu1 [37.3 kB]
Get:34 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libnginx-mod-http-image-filter amd64 1.18.0-0ubuntu1 [14.3 kB]
Get:35 http://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libxslt1.1 amd64 1.1.34-4 [152 kB]
Get:36 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.18.0-0ubuntu1 [12.6 kB]
Get:37 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libnginx-mod-mail amd64 1.18.0-0ubuntu1 [42.3 kB]
Get:38 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 libnginx-mod-stream amd64 1.18.0-0ubuntu1 [66.9 kB]
Get:39 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 nginx-core amd64 1.18.0-0ubuntu1 [425 kB]
Get:40 http://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 nginx all 1.18.0-0ubuntu1 [3624 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 15.8 MB in 1s (13.5 MB/s)
Selecting previously unselected package libbsd0:amd64.
(Reading database ... 4121 files and directories currently installed.)
Preparing to unpack .../00-libbsd0_0.10.0-1_amd64.deb ...
Unpacking libbsd0:amd64 (0.10.0-1) ...
Selecting previously unselected package libcap2:amd64.
Preparing to unpack .../01-libcap2_1%3a2.32-1_amd64.deb ...
Unpacking libcap2:amd64 (1:2.32-1) ...
Selecting previously unselected package libelf1:amd64.
Preparing to unpack .../02-libelf1_0.176-1.1build1_amd64.deb ...
Unpacking libelf1:amd64 (0.176-1.1build1) ...
Selecting previously unselected package libmnl0:amd64.
Preparing to unpack .../03-libmnl0_1.0.4-2_amd64.deb ...
Unpacking libmnl0:amd64 (1.0.4-2) ...
Selecting previously unselected package libxtables12:amd64.
Preparing to unpack .../04-libxtables12_1.8.4-3ubuntu2_amd64.deb ...
Unpacking libxtables12:amd64 (1.8.4-3ubuntu2) ...
Selecting previously unselected package libcap2-bin.
Preparing to unpack .../05-libcap2-bin_1%3a2.32-1_amd64.deb ...
Unpacking libcap2-bin (1:2.32-1) ...
Selecting previously unselected package iproute2.
Preparing to unpack .../06-iproute2_5.5.0-1ubuntu1_amd64.deb ...
Unpacking iproute2 (5.5.0-1ubuntu1) ...
Selecting previously unselected package libatm1:amd64.
Preparing to unpack .../07-libatm1_1%3a2.5.1-4_amd64.deb ...
Unpacking libatm1:amd64 (1:2.5.1-4) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../08-libexpat1_2.2.9-1build1_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.9-1build1) ...
Selecting previously unselected package tzdata.
Preparing to unpack .../09-tzdata_2021a-0ubuntu0.20.04_all.deb ...
Unpacking tzdata (2021a-0ubuntu0.20.04) ...
Selecting previously unselected package libicu66:amd64.
Preparing to unpack .../10-libicu66_66.1-2ubuntu2_amd64.deb ...
Unpacking libicu66:amd64 (66.1-2ubuntu2) ...
Selecting previously unselected package libpam-cap:amd64.
Preparing to unpack .../11-libpam-cap_1%3a2.32-1_amd64.deb ...
Unpacking libpam-cap:amd64 (1:2.32-1) ...
Selecting previously unselected package libssl1.1:amd64.
Preparing to unpack .../12-libssl1.1_1.1.1f-1ubuntu2.2_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1f-1ubuntu2.2) ...
Selecting previously unselected package libxml2:amd64.
Preparing to unpack .../13-libxml2_2.9.10+dfsg-5_amd64.deb ...
Unpacking libxml2:amd64 (2.9.10+dfsg-5) ...
Selecting previously unselected package ucf.
Preparing to unpack .../14-ucf_3.0038+nmu1_all.deb ...
Moving old data out of the way
Unpacking ucf (3.0038+nmu1) ...
Selecting previously unselected package libpng16-16:amd64.
Preparing to unpack .../15-libpng16-16_1.6.37-2_amd64.deb ...
Unpacking libpng16-16:amd64 (1.6.37-2) ...
Selecting previously unselected package libxau6:amd64.
Preparing to unpack .../16-libxau6_1%3a1.0.9-0ubuntu1_amd64.deb ...
Unpacking libxau6:amd64 (1:1.0.9-0ubuntu1) ...
Selecting previously unselected package libxdmcp6:amd64.
Preparing to unpack .../17-libxdmcp6_1%3a1.1.3-0ubuntu1_amd64.deb ...
Unpacking libxdmcp6:amd64 (1:1.1.3-0ubuntu1) ...
Selecting previously unselected package libxcb1:amd64.
Preparing to unpack .../18-libxcb1_1.14-2_amd64.deb ...
Unpacking libxcb1:amd64 (1.14-2) ...
Selecting previously unselected package libx11-data.
Preparing to unpack .../19-libx11-data_2%3a1.6.9-2ubuntu1.1_all.deb ...
Unpacking libx11-data (2:1.6.9-2ubuntu1.1) ...
Selecting previously unselected package libx11-6:amd64.
Preparing to unpack .../20-libx11-6_2%3a1.6.9-2ubuntu1.1_amd64.deb ...
Unpacking libx11-6:amd64 (2:1.6.9-2ubuntu1.1) ...
Selecting previously unselected package fonts-dejavu-core.
Preparing to unpack .../21-fonts-dejavu-core_2.37-1_all.deb ...
Unpacking fonts-dejavu-core (2.37-1) ...
Selecting previously unselected package fontconfig-config.
Preparing to unpack .../22-fontconfig-config_2.13.1-2ubuntu3_all.deb ...
Unpacking fontconfig-config (2.13.1-2ubuntu3) ...
Selecting previously unselected package libfreetype6:amd64.
Preparing to unpack .../23-libfreetype6_2.10.1-2ubuntu0.1_amd64.deb ...
Unpacking libfreetype6:amd64 (2.10.1-2ubuntu0.1) ...
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack .../24-libfontconfig1_2.13.1-2ubuntu3_amd64.deb ...
Unpacking libfontconfig1:amd64 (2.13.1-2ubuntu3) ...
Selecting previously unselected package libjpeg-turbo8:amd64.
Preparing to unpack .../25-libjpeg-turbo8_2.0.3-0ubuntu1.20.04.1_amd64.deb ...
Unpacking libjpeg-turbo8:amd64 (2.0.3-0ubuntu1.20.04.1) ...
Selecting previously unselected package libjpeg8:amd64.
Preparing to unpack .../26-libjpeg8_8c-2ubuntu8_amd64.deb ...
Unpacking libjpeg8:amd64 (8c-2ubuntu8) ...
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack .../27-libjbig0_2.1-3.1build1_amd64.deb ...
Unpacking libjbig0:amd64 (2.1-3.1build1) ...
Selecting previously unselected package libwebp6:amd64.
Preparing to unpack .../28-libwebp6_0.6.1-2_amd64.deb ...
Unpacking libwebp6:amd64 (0.6.1-2) ...
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack .../29-libtiff5_4.1.0+git191117-2ubuntu0.20.04.1_amd64.deb ...
Unpacking libtiff5:amd64 (4.1.0+git191117-2ubuntu0.20.04.1) ...
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack .../30-libxpm4_1%3a3.5.12-1_amd64.deb ...
Unpacking libxpm4:amd64 (1:3.5.12-1) ...
Selecting previously unselected package libgd3:amd64.
Preparing to unpack .../31-libgd3_2.2.5-5.2ubuntu2_amd64.deb ...
Unpacking libgd3:amd64 (2.2.5-5.2ubuntu2) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../32-nginx-common_1.18.0-0ubuntu1_all.deb ...
Unpacking nginx-common (1.18.0-0ubuntu1) ...
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack .../33-libnginx-mod-http-image-filter_1.18.0-0ubuntu1_amd64.deb ...
Unpacking libnginx-mod-http-image-filter (1.18.0-0ubuntu1) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../34-libxslt1.1_1.1.34-4_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.34-4) ...
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack .../35-libnginx-mod-http-xslt-filter_1.18.0-0ubuntu1_amd64.deb ...
Unpacking libnginx-mod-http-xslt-filter (1.18.0-0ubuntu1) ...
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack .../36-libnginx-mod-mail_1.18.0-0ubuntu1_amd64.deb ...
Unpacking libnginx-mod-mail (1.18.0-0ubuntu1) ...
Selecting previously unselected package libnginx-mod-stream.
Preparing to unpack .../37-libnginx-mod-stream_1.18.0-0ubuntu1_amd64.deb ...
Unpacking libnginx-mod-stream (1.18.0-0ubuntu1) ...
Selecting previously unselected package nginx-core.
Preparing to unpack .../38-nginx-core_1.18.0-0ubuntu1_amd64.deb ...
Unpacking nginx-core (1.18.0-0ubuntu1) ...
Selecting previously unselected package nginx.
Preparing to unpack .../39-nginx_1.18.0-0ubuntu1_all.deb ...
Unpacking nginx (1.18.0-0ubuntu1) ...
Setting up libexpat1:amd64 (2.2.9-1build1) ...
Setting up libxau6:amd64 (1:1.0.9-0ubuntu1) ...
Setting up libssl1.1:amd64 (1.1.1f-1ubuntu2.2) ...
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.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /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 nginx-common (1.18.0-0ubuntu1) ...
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.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /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 libatm1:amd64 (1:2.5.1-4) ...
Setting up libjbig0:amd64 (2.1-3.1build1) ...
Setting up libcap2:amd64 (1:2.32-1) ...
Setting up tzdata (2021a-0ubuntu0.20.04) ...
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.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /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
Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

  1. Africa      4. Australia  7. Atlantic  10. Pacific  13. Etc
  2. America     5. Arctic     8. Europe    11. SystemV
  3. Antarctica  6. Asia       9. Indian    12. US
Geographic area: 
Use of uninitialized value $_[1] in join or string at /usr/share/perl5/Debconf/DbDriver/Stack.pm line 111.

Current default time zone: '/UTC'
Local time is now:      Mon Mar 22 14:44:23 UTC 2021.
Universal Time is now:  Mon Mar 22 14:44:23 UTC 2021.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

Use of uninitialized value $val in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 83, <GEN6> line 4.
Use of uninitialized value $val in concatenation (.) or string at /usr/share/perl5/Debconf/Format/822.pm line 84, <GEN6> line 4.
Setting up libcap2-bin (1:2.32-1) ...
Setting up libx11-data (2:1.6.9-2ubuntu1.1) ...
Setting up libpng16-16:amd64 (1.6.37-2) ...
Setting up libmnl0:amd64 (1.0.4-2) ...
Setting up libwebp6:amd64 (0.6.1-2) ...
Setting up fonts-dejavu-core (2.37-1) ...
Setting up ucf (3.0038+nmu1) ...
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.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /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 libjpeg-turbo8:amd64 (2.0.3-0ubuntu1.20.04.1) ...
Setting up libxtables12:amd64 (1.8.4-3ubuntu2) ...
Setting up libbsd0:amd64 (0.10.0-1) ...
Setting up libelf1:amd64 (0.176-1.1build1) ...
Setting up libpam-cap:amd64 (1:2.32-1) ...
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.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /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 libjpeg8:amd64 (8c-2ubuntu8) ...
Setting up libnginx-mod-mail (1.18.0-0ubuntu1) ...
Setting up libxdmcp6:amd64 (1:1.1.3-0ubuntu1) ...
Setting up libxcb1:amd64 (1.14-2) ...
Setting up fontconfig-config (2.13.1-2ubuntu3) ...
Setting up iproute2 (5.5.0-1ubuntu1) ...
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.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /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 libicu66:amd64 (66.1-2ubuntu2) ...
Setting up libnginx-mod-stream (1.18.0-0ubuntu1) ...
Setting up libfreetype6:amd64 (2.10.1-2ubuntu0.1) ...
Setting up libx11-6:amd64 (2:1.6.9-2ubuntu1.1) ...
Setting up libtiff5:amd64 (4.1.0+git191117-2ubuntu0.20.04.1) ...
Setting up libfontconfig1:amd64 (2.13.1-2ubuntu3) ...
Setting up libxml2:amd64 (2.9.10+dfsg-5) ...
Setting up libxpm4:amd64 (1:3.5.12-1) ...
Setting up libgd3:amd64 (2.2.5-5.2ubuntu2) ...
Setting up libxslt1.1:amd64 (1.1.34-4) ...
Setting up libnginx-mod-http-image-filter (1.18.0-0ubuntu1) ...
Setting up libnginx-mod-http-xslt-filter (1.18.0-0ubuntu1) ...
Setting up nginx-core (1.18.0-0ubuntu1) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up nginx (1.18.0-0ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Removing intermediate container c3a0d19aa12d
 ---> 30b0176b4eee
Step 6/8 : COPY index.html /var/www/html
 ---> 84e29ef37325
Step 7/8 : ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off;"]
 ---> Running in 339104070a88
Removing intermediate container 339104070a88
 ---> 882605fd106a
Step 8/8 : EXPOSE 80
 ---> Running in a603fe2e77ff
Removing intermediate container a603fe2e77ff
 ---> 795b366fe48d
Successfully built 795b366fe48d
Successfully tagged root/hello-nginx:latest
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# docker run -d -p 80:80 root/hello-nginx
24b4ed0376b63d297c0e950dcb4d397e4d713452be2ed6fe216da08d23944b0e
docker: Error response from daemon: driver failed programming external connectivity on endpoint sleepy_kare (2d4f89cb3e32a74686fdffa67c4d3d999d2ba0d5f7580b5889ca8177bf5cad54): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use.
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# docker ps
CONTAINER ID   IMAGE     COMMAND                  CREATED       STATUS       PORTS                  NAMES
ae4a8e6d3a00   nginx     "/docker-entrypoint.…"   2 hours ago   Up 2 hours   0.0.0.0:8080->80/tcp   nifty_babbage
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# docker stop ae4a8e6d3a00
ae4a8e6d3a00
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# docker run -d -p 80:80 root/hello-nginx
da40d998766073ba9992c05189e785fb361973a5ed98dd01c198a716a9121923
docker: Error response from daemon: driver failed programming external connectivity on endpoint charming_payne (451a0310c10e621b392a0ccda39fd512e2691ad7f7190689ebde6f5db43ef7e2): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use.
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# docker run -d -p 80:80 root/hello-nginx
dcb83c462d363e03d2f466eb4543d65d1f1e83d1dfbc13f7432aae08ccd07659
docker: Error response from daemon: driver failed programming external connectivity on endpoint gallant_hopper (f31d42850b3f598f8c729a2aa3707ba0c59e09a9de404617663c6c533aafbf0b): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use.
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# docker run -d -p 80:80 root/hello-nginx
33d13835ea4ef6f036bd3a3a6921f8a873d3692efa4dbdb98c10ae84b9fd01a9
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# curl http://localhost
今天是周一
root@iZbp1berl2oy3e3vt5476fZ:~/dockerfiler2# 
touch Dockerfile

vim Dockerfile

FROM ubuntu
MAINTAINER root
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y nginx
COPY index.html /var/www/html
ENTRYPOINT ["/usr/sbin/nginx", "-g", "daemon off;"]
EXPOSE 80
touch index.html
vim index.html
docker build -t root/hello-nginx .
docker run -d -p 80:80 root/hello-nginx

猜你喜欢

转载自blog.csdn.net/huanglianggu/article/details/115101973