What is Dockerfile and what is dockerfile used for ??

What is Dockerfile and what is dockerfile used for ??

A Dockerfile is a text configuration file with specific syntax and pattern. From the dockerfile, docker image is generated. Dockerfile describes step-by-step instruction of all the commands we need to generate a docker image. Dockerfile must be saved with the proper name “Dockerfile”, it's case sensitive, so we need to take care of that.

We can generate docker image by firing the command “docker build”, where the Dockerfile is placed.

How To Create Dockerfile

Creating a Dockerfile is as easy as creating a regular file in the system. We can landup into any directory which have proper permission to run the docker command. In the same directory, we can simply create a  new file and named it as a Dockerfile.

In the below Code is how the exact Dockerfile looks like.

# The line below states we will base our new image on the Latest Official Ubuntu
FROM ubuntu:latest
#
# Identify the maintainer of an image
LABEL maintainer="learn@dockerfile.com"
#
# Update the image to the latest packages
RUN apt-get update && apt-get upgrade -y
#
# Install NGINX to test.
RUN apt-get install nginx -y
#
# Expose port 80
EXPOSE 80
#
# Last is the actual command to start up NGINX within our Container
CMD ["nginx", "-g", "daemon off;"]

Create Docker Image from the dockerfile

We can specify the command we need in order to make the image from the docker file. In the image code, I have deployed nginx web-server to run the application. To build an image from the Dockerfile, we need to get into the place where Dockerfile resides.
And then fire the command as shown below, “docker build -t nginx-demo .” Here, -t stands for the tag of the image, which here we have given nginx-demo, and dot(.) represnets the dockerfile in the current directory.

$ docker build -t nginx-demo .

Sending build context to Docker daemon  2.048kB
Step 1/6 : FROM ubuntu:latest
 ---> 16508e5c265d
Step 2/6 : LABEL maintainer="learn@dockerfile.com"
 ---> Running in 9a06f3ac38db
Removing intermediate container 9a06f3ac38db
 ---> c625b767d4ad
Step 3/6 : RUN apt-get update && apt-get upgrade -y
 ---> Running in 791acb66f251
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/universe Sources [225 kB]
Get:6 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [116 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [10.1 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [1093 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [902 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic/universe Sources [11.5 MB]
Get:11 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/universe Sources [381 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [27.7 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [132 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1429 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [1385 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [8286 B]
Get:21 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [8432 B]
Fetched 30.6 MB in 4s (6896 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
  apt base-files bash bsdutils bzip2 debconf dpkg e2fsprogs fdisk gcc-8-base
  gpgv grep libapt-pkg5.0 libblkid1 libbz2-1.0 libc-bin libc6 libcom-err2
  libdb5.3 libext2fs2 libfdisk1 libgcc1 libgcrypt20 libgnutls30 libidn2-0
  libmount1 libpam-modules libpam-modules-bin libpam-runtime libpam0g
  libprocps6 libseccomp2 libsmartcols1 libss2 libstdc++6 libsystemd0 libudev1
  libunistring2 libuuid1 libzstd1 login mount passwd perl-base procps tar
  ubuntu-keyring util-linux
48 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.6 MB of archives.
After this operation, 193 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gcc-8-base amd64 8.4.0-1ubuntu1~18.04 [18.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libgcc1 amd64 1:8.4.0-1ubuntu1~18.04 [40.6 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libstdc++6 amd64 8.4.0-1ubuntu1~18.04 [400 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libc6 amd64 2.27-3ubuntu1.2 [2827 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 base-files amd64 10.1ubuntu2.10 [60.4 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 bash amd64 4.4.18-2ubuntu1.2 [614 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 bsdutils amd64 1:2.31.1-0.4ubuntu3.7 [60.2 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 tar amd64 1.29b-2ubuntu0.1 [234 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 dpkg amd64 1.19.0.5ubuntu2.3 [1136 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libext2fs2 amd64 1.44.1-1ubuntu1.3 [157 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 e2fsprogs amd64 1.44.1-1ubuntu1.3 [391 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 grep amd64 3.1-2build1 [159 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 login amd64 1:4.5-1ubuntu2 [308 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 perl-base amd64 5.26.1-6ubuntu0.3 [1390 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libuuid1 amd64 2.31.1-0.4ubuntu3.7 [20.1 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libblkid1 amd64 2.31.1-0.4ubuntu3.7 [124 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libfdisk1 amd64 2.31.1-0.4ubuntu3.7 [164 kB]
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libmount1 amd64 2.31.1-0.4ubuntu3.7 [136 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsmartcols1 amd64 2.31.1-0.4ubuntu3.7 [83.8 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 fdisk amd64 2.31.1-0.4ubuntu3.7 [108 kB]
Get:21 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 util-linux amd64 2.31.1-0.4ubuntu3.7 [904 kB]
Get:22 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libc-bin amd64 2.27-3ubuntu1.2 [637 kB]
Get:23 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 bzip2 amd64 1.0.6-8.1ubuntu0.2 [33.9 kB]
Get:24 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libbz2-1.0 amd64 1.0.6-8.1ubuntu0.2 [31.2 kB]
Get:25 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsystemd0 amd64 237-3ubuntu10.42 [208 kB]
Get:26 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libudev1 amd64 237-3ubuntu10.42 [57.4 kB]
Get:27 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libzstd1 amd64 1.3.3+dfsg-2ubuntu1.1 [189 kB]
Get:28 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libapt-pkg5.0 amd64 1.6.12ubuntu0.1 [807 kB]
Get:29 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libgcrypt20 amd64 1.8.1-4ubuntu1.2 [417 kB]
Get:30 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 gpgv amd64 2.2.4-1ubuntu1.2 [198 kB]
Get:31 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 ubuntu-keyring all 2018.09.18.1~18.04.0 [22.4 kB]
Get:32 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libunistring2 amd64 0.9.9-0ubuntu2 [368 kB]
Get:33 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libidn2-0 amd64 2.0.4-1.1ubuntu0.2 [48.7 kB]
Get:34 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libgnutls30 amd64 3.5.18-1ubuntu1.4 [645 kB]
Get:35 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libseccomp2 amd64 2.4.3-1ubuntu3.18.04.3 [42.0 kB]
Get:36 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 apt amd64 1.6.12ubuntu0.1 [1201 kB]
Get:37 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 debconf all 1.5.66ubuntu1 [124 kB]
Get:38 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpam0g amd64 1.1.8-3.6ubuntu2.18.04.2 [54.9 kB]
Get:39 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpam-modules-bin amd64 1.1.8-3.6ubuntu2.18.04.2 [36.7 kB]
Get:40 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpam-modules amd64 1.1.8-3.6ubuntu2.18.04.2 [242 kB]
Get:41 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 mount amd64 2.31.1-0.4ubuntu3.7 [107 kB]
Get:42 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libcom-err2 amd64 1.44.1-1ubuntu1.3 [8848 B]
Get:43 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libdb5.3 amd64 5.3.28-13.1ubuntu1.1 [672 kB]
Get:44 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpam-runtime all 1.1.8-3.6ubuntu2.18.04.2 [37.1 kB]
Get:45 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libss2 amd64 1.44.1-1ubuntu1.3 [11.1 kB]
Get:46 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 passwd amd64 1:4.5-1ubuntu2 [816 kB]
Get:47 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libprocps6 amd64 2:3.3.12-3ubuntu1.2 [31.8 kB]
Get:48 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 procps amd64 2:3.3.12-3ubuntu1.2 [225 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 16.6 MB in 0s (33.8 MB/s)
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../gcc-8-base_8.4.0-1ubuntu1~18.04_amd64.deb ...
Unpacking gcc-8-base:amd64 (8.4.0-1ubuntu1~18.04) over (8-20180414-1ubuntu2) ...
Setting up gcc-8-base:amd64 (8.4.0-1ubuntu1~18.04) ...
(Reading database ... 4036 files and directories currently installed.)
Preparing to unpack .../libgcc1_1%3a8.4.0-1ubuntu1~18.04_amd64.deb ...
Unpacking libgcc1:amd64 (1:8.4.0-1ubuntu1~18.04) over (1:8-20180414-1ubuntu2) ...
Setting up libgcc1:amd64 (1:8.4.0-1ubuntu1~18.04) ...
(Reading database ... 4036 files and directories currently installed.)
Preparing to unpack .../libstdc++6_8.4.0-1ubuntu1~18.04_amd64.deb ...
Unpacking libstdc++6:amd64 (8.4.0-1ubuntu1~18.04) over (8-20180414-1ubuntu2) ...
Setting up libstdc++6:amd64 (8.4.0-1ubuntu1~18.04) ...
(Reading database ... 4036 files and directories currently installed.)
Preparing to unpack .../libc6_2.27-3ubuntu1.2_amd64.deb ...
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
Unpacking libc6:amd64 (2.27-3ubuntu1.2) over (2.27-3ubuntu1) ...
Setting up libc6:amd64 (2.27-3ubuntu1.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.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
(Reading database ... 4036 files and directories currently installed.)
Preparing to unpack .../base-files_10.1ubuntu2.10_amd64.deb ...
Unpacking base-files (10.1ubuntu2.10) over (10.1ubuntu2.2) ...
Setting up base-files (10.1ubuntu2.10) ...
Installing new version of config file /etc/issue ...
Installing new version of config file /etc/issue.net ...
Installing new version of config file /etc/lsb-release ...
Installing new version of config file /etc/update-motd.d/50-motd-news ...
Removing obsolete conffile /etc/default/motd-news ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../bash_4.4.18-2ubuntu1.2_amd64.deb ...
Unpacking bash (4.4.18-2ubuntu1.2) over (4.4.18-2ubuntu1) ...
Setting up bash (4.4.18-2ubuntu1.2) ...
update-alternatives: error: alternative path /usr/share/man/man7/bash-builtins.7.gz doesn't exist
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../bsdutils_1%3a2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking bsdutils (1:2.31.1-0.4ubuntu3.7) over (1:2.31.1-0.4ubuntu3.1) ...
Setting up bsdutils (1:2.31.1-0.4ubuntu3.7) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../tar_1.29b-2ubuntu0.1_amd64.deb ...
Unpacking tar (1.29b-2ubuntu0.1) over (1.29b-2) ...
Setting up tar (1.29b-2ubuntu0.1) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../dpkg_1.19.0.5ubuntu2.3_amd64.deb ...
Unpacking dpkg (1.19.0.5ubuntu2.3) over (1.19.0.5ubuntu2) ...
Setting up dpkg (1.19.0.5ubuntu2.3) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libext2fs2_1.44.1-1ubuntu1.3_amd64.deb ...
Unpacking libext2fs2:amd64 (1.44.1-1ubuntu1.3) over (1.44.1-1) ...
Setting up libext2fs2:amd64 (1.44.1-1ubuntu1.3) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../e2fsprogs_1.44.1-1ubuntu1.3_amd64.deb ...
Unpacking e2fsprogs (1.44.1-1ubuntu1.3) over (1.44.1-1) ...
Setting up e2fsprogs (1.44.1-1ubuntu1.3) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../grep_3.1-2build1_amd64.deb ...
Unpacking grep (3.1-2build1) over (3.1-2) ...
Setting up grep (3.1-2build1) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../login_1%3a4.5-1ubuntu2_amd64.deb ...
Unpacking login (1:4.5-1ubuntu2) over (1:4.5-1ubuntu1) ...
Setting up login (1:4.5-1ubuntu2) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../perl-base_5.26.1-6ubuntu0.3_amd64.deb ...
Unpacking perl-base (5.26.1-6ubuntu0.3) over (5.26.1-6ubuntu0.2) ...
Setting up perl-base (5.26.1-6ubuntu0.3) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libuuid1_2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking libuuid1:amd64 (2.31.1-0.4ubuntu3.7) over (2.31.1-0.4ubuntu3.1) ...
Setting up libuuid1:amd64 (2.31.1-0.4ubuntu3.7) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libblkid1_2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking libblkid1:amd64 (2.31.1-0.4ubuntu3.7) over (2.31.1-0.4ubuntu3.1) ...
Setting up libblkid1:amd64 (2.31.1-0.4ubuntu3.7) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libfdisk1_2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking libfdisk1:amd64 (2.31.1-0.4ubuntu3.7) over (2.31.1-0.4ubuntu3.1) ...
Setting up libfdisk1:amd64 (2.31.1-0.4ubuntu3.7) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libmount1_2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking libmount1:amd64 (2.31.1-0.4ubuntu3.7) over (2.31.1-0.4ubuntu3.1) ...
Setting up libmount1:amd64 (2.31.1-0.4ubuntu3.7) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libsmartcols1_2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking libsmartcols1:amd64 (2.31.1-0.4ubuntu3.7) over (2.31.1-0.4ubuntu3.1) ...
Setting up libsmartcols1:amd64 (2.31.1-0.4ubuntu3.7) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../fdisk_2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking fdisk (2.31.1-0.4ubuntu3.7) over (2.31.1-0.4ubuntu3.1) ...
Setting up fdisk (2.31.1-0.4ubuntu3.7) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../util-linux_2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking util-linux (2.31.1-0.4ubuntu3.7) over (2.31.1-0.4ubuntu3.1) ...
Setting up util-linux (2.31.1-0.4ubuntu3.7) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.27-3ubuntu1.2_amd64.deb ...
Unpacking libc-bin (2.27-3ubuntu1.2) over (2.27-3ubuntu1) ...
Setting up libc-bin (2.27-3ubuntu1.2) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../bzip2_1.0.6-8.1ubuntu0.2_amd64.deb ...
Unpacking bzip2 (1.0.6-8.1ubuntu0.2) over (1.0.6-8.1) ...
Preparing to unpack .../libbz2-1.0_1.0.6-8.1ubuntu0.2_amd64.deb ...
Unpacking libbz2-1.0:amd64 (1.0.6-8.1ubuntu0.2) over (1.0.6-8.1) ...
Setting up libbz2-1.0:amd64 (1.0.6-8.1ubuntu0.2) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libsystemd0_237-3ubuntu10.42_amd64.deb ...
Unpacking libsystemd0:amd64 (237-3ubuntu10.42) over (237-3ubuntu10.3) ...
Setting up libsystemd0:amd64 (237-3ubuntu10.42) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libudev1_237-3ubuntu10.42_amd64.deb ...
Unpacking libudev1:amd64 (237-3ubuntu10.42) over (237-3ubuntu10.3) ...
Setting up libudev1:amd64 (237-3ubuntu10.42) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libzstd1_1.3.3+dfsg-2ubuntu1.1_amd64.deb ...
Unpacking libzstd1:amd64 (1.3.3+dfsg-2ubuntu1.1) over (1.3.3+dfsg-2ubuntu1) ...
Setting up libzstd1:amd64 (1.3.3+dfsg-2ubuntu1.1) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libapt-pkg5.0_1.6.12ubuntu0.1_amd64.deb ...
Unpacking libapt-pkg5.0:amd64 (1.6.12ubuntu0.1) over (1.6.3ubuntu0.1) ...
Setting up libapt-pkg5.0:amd64 (1.6.12ubuntu0.1) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../libgcrypt20_1.8.1-4ubuntu1.2_amd64.deb ...
Unpacking libgcrypt20:amd64 (1.8.1-4ubuntu1.2) over (1.8.1-4ubuntu1.1) ...
Setting up libgcrypt20:amd64 (1.8.1-4ubuntu1.2) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../gpgv_2.2.4-1ubuntu1.2_amd64.deb ...
Unpacking gpgv (2.2.4-1ubuntu1.2) over (2.2.4-1ubuntu1.1) ...
Setting up gpgv (2.2.4-1ubuntu1.2) ...
(Reading database ... 4037 files and directories currently installed.)
Preparing to unpack .../ubuntu-keyring_2018.09.18.1~18.04.0_all.deb ...
Unpacking ubuntu-keyring (2018.09.18.1~18.04.0) over (2018.02.28) ...
Setting up ubuntu-keyring (2018.09.18.1~18.04.0) ...
(Reading database ... 4038 files and directories currently installed.)
Preparing to unpack .../libunistring2_0.9.9-0ubuntu2_amd64.deb ...
Unpacking libunistring2:amd64 (0.9.9-0ubuntu2) over (0.9.9-0ubuntu1) ...
Setting up libunistring2:amd64 (0.9.9-0ubuntu2) ...
(Reading database ... 4038 files and directories currently installed.)
Preparing to unpack .../libidn2-0_2.0.4-1.1ubuntu0.2_amd64.deb ...
Unpacking libidn2-0:amd64 (2.0.4-1.1ubuntu0.2) over (2.0.4-1.1build2) ...
Setting up libidn2-0:amd64 (2.0.4-1.1ubuntu0.2) ...
(Reading database ... 4038 files and directories currently installed.)
Preparing to unpack .../libgnutls30_3.5.18-1ubuntu1.4_amd64.deb ...
Unpacking libgnutls30:amd64 (3.5.18-1ubuntu1.4) over (3.5.18-1ubuntu1) ...
Setting up libgnutls30:amd64 (3.5.18-1ubuntu1.4) ...
(Reading database ... 4038 files and directories currently installed.)
Preparing to unpack .../libseccomp2_2.4.3-1ubuntu3.18.04.3_amd64.deb ...
Unpacking libseccomp2:amd64 (2.4.3-1ubuntu3.18.04.3) over (2.3.1-2.1ubuntu4) ...
Setting up libseccomp2:amd64 (2.4.3-1ubuntu3.18.04.3) ...
(Reading database ... 4038 files and directories currently installed.)
Preparing to unpack .../apt_1.6.12ubuntu0.1_amd64.deb ...
Unpacking apt (1.6.12ubuntu0.1) over (1.6.3ubuntu0.1) ...
Setting up apt (1.6.12ubuntu0.1) ...
Installing new version of config file /etc/apt/apt.conf.d/01autoremove ...
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../debconf_1.5.66ubuntu1_all.deb ...
Unpacking debconf (1.5.66ubuntu1) over (1.5.66) ...
Setting up debconf (1.5.66ubuntu1) ...
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
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../libpam0g_1.1.8-3.6ubuntu2.18.04.2_amd64.deb ...
Unpacking libpam0g:amd64 (1.1.8-3.6ubuntu2.18.04.2) over (1.1.8-3.6ubuntu2) ...
Setting up libpam0g:amd64 (1.1.8-3.6ubuntu2.18.04.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.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
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../libpam-modules-bin_1.1.8-3.6ubuntu2.18.04.2_amd64.deb ...
Unpacking libpam-modules-bin (1.1.8-3.6ubuntu2.18.04.2) over (1.1.8-3.6ubuntu2) ...
Setting up libpam-modules-bin (1.1.8-3.6ubuntu2.18.04.2) ...
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../libpam-modules_1.1.8-3.6ubuntu2.18.04.2_amd64.deb ...
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
Unpacking libpam-modules:amd64 (1.1.8-3.6ubuntu2.18.04.2) over (1.1.8-3.6ubuntu2) ...
Setting up libpam-modules:amd64 (1.1.8-3.6ubuntu2.18.04.2) ...
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../mount_2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking mount (2.31.1-0.4ubuntu3.7) over (2.31.1-0.4ubuntu3.1) ...
Preparing to unpack .../libcom-err2_1.44.1-1ubuntu1.3_amd64.deb ...
Unpacking libcom-err2:amd64 (1.44.1-1ubuntu1.3) over (1.44.1-1) ...
Setting up libcom-err2:amd64 (1.44.1-1ubuntu1.3) ...
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../libdb5.3_5.3.28-13.1ubuntu1.1_amd64.deb ...
Unpacking libdb5.3:amd64 (5.3.28-13.1ubuntu1.1) over (5.3.28-13.1ubuntu1) ...
Setting up libdb5.3:amd64 (5.3.28-13.1ubuntu1.1) ...
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../libpam-runtime_1.1.8-3.6ubuntu2.18.04.2_all.deb ...
Unpacking libpam-runtime (1.1.8-3.6ubuntu2.18.04.2) over (1.1.8-3.6ubuntu2) ...
Setting up libpam-runtime (1.1.8-3.6ubuntu2.18.04.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.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
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../libss2_1.44.1-1ubuntu1.3_amd64.deb ...
Unpacking libss2:amd64 (1.44.1-1ubuntu1.3) over (1.44.1-1) ...
Setting up libss2:amd64 (1.44.1-1ubuntu1.3) ...
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../passwd_1%3a4.5-1ubuntu2_amd64.deb ...
Unpacking passwd (1:4.5-1ubuntu2) over (1:4.5-1ubuntu1) ...
Setting up passwd (1:4.5-1ubuntu2) ...
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../libprocps6_2%3a3.3.12-3ubuntu1.2_amd64.deb ...
Unpacking libprocps6:amd64 (2:3.3.12-3ubuntu1.2) over (2:3.3.12-3ubuntu1.1) ...
Preparing to unpack .../procps_2%3a3.3.12-3ubuntu1.2_amd64.deb ...
Unpacking procps (2:3.3.12-3ubuntu1.2) over (2:3.3.12-3ubuntu1.1) ...
Setting up mount (2.31.1-0.4ubuntu3.7) ...
Setting up libprocps6:amd64 (2:3.3.12-3ubuntu1.2) ...
Setting up bzip2 (1.0.6-8.1ubuntu0.2) ...
Setting up procps (2:3.3.12-3ubuntu1.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
Removing intermediate container 791acb66f251
 ---> 538c5534dfd6
Step 4/6 : RUN apt-get install nginx -y
 ---> Running in e8d5920132a5
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  fontconfig-config fonts-dejavu-core geoip-database iproute2 libatm1 libbsd0
  libelf1 libexpat1 libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu60
  libjbig0 libjpeg-turbo8 libjpeg8 libmnl0 libnginx-mod-http-geoip
  libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter
  libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
  libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
  libxslt1.1 libxtables12 multiarch-support nginx-common nginx-core ucf
Suggested packages:
  iproute2-doc libgd-tools geoip-bin fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  fontconfig-config fonts-dejavu-core geoip-database iproute2 libatm1 libbsd0
  libelf1 libexpat1 libfontconfig1 libfreetype6 libgd3 libgeoip1 libicu60
  libjbig0 libjpeg-turbo8 libjpeg8 libmnl0 libnginx-mod-http-geoip
  libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter
  libnginx-mod-mail libnginx-mod-stream libpng16-16 libssl1.1 libtiff5
  libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4
  libxslt1.1 libxtables12 multiarch-support nginx nginx-common nginx-core ucf
0 upgraded, 40 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.1 MB of archives.
After this operation, 61.9 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 multiarch-support amd64 2.27-3ubuntu1.2 [6920 B]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libjpeg-turbo8 amd64 1.5.2-0ubuntu5.18.04.4 [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libelf1 amd64 0.170-0.4ubuntu0.1 [44.8 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmnl0 amd64 1.0.4-2 [12.3 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 iproute2 amd64 4.15.0-2ubuntu1.2 [722 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic/main amd64 libatm1 amd64 1:2.5.1-2build1 [21.9 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libbsd0 amd64 0.8.7-1ubuntu0.1 [41.6 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libexpat1 amd64 2.2.5-3ubuntu0.2 [80.5 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libicu60 amd64 60.2-3ubuntu3.1 [8054 kB]
Get:10 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libssl1.1 amd64 1.1.1-1ubuntu2.1~18.04.6 [1301 kB]
Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libxml2 amd64 2.9.4+dfsg1-6.1ubuntu1.3 [663 kB]
Get:12 http://archive.ubuntu.com/ubuntu bionic/main amd64 libxtables12 amd64 1.6.1-2ubuntu2 [27.9 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic/main amd64 ucf all 3.0038 [50.5 kB]
Get:14 http://archive.ubuntu.com/ubuntu bionic/main amd64 geoip-database all 20180315-1 [2090 kB]
Get:15 http://archive.ubuntu.com/ubuntu bionic/main amd64 libgeoip1 amd64 1.6.12-1 [71.8 kB]
Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpng16-16 amd64 1.6.34-1ubuntu0.18.04.2 [176 kB]
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libxau6 amd64 1:1.0.8-1ubuntu1 [7556 B]
Get:18 http://archive.ubuntu.com/ubuntu bionic/main amd64 libxdmcp6 amd64 1:1.1.2-3 [10.7 kB]
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libxcb1 amd64 1.13-2~ubuntu18.04 [45.5 kB]
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libx11-data all 2:1.6.4-3ubuntu0.3 [114 kB]
Get:21 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libx11-6 amd64 2:1.6.4-3ubuntu0.3 [571 kB]
Get:22 http://archive.ubuntu.com/ubuntu bionic/main amd64 fonts-dejavu-core all 2.37-1 [1041 kB]
Get:23 http://archive.ubuntu.com/ubuntu bionic/main amd64 fontconfig-config all 2.12.6-0ubuntu2 [55.8 kB]
Get:24 http://archive.ubuntu.com/ubuntu bionic/main amd64 libfreetype6 amd64 2.8.1-2ubuntu2 [335 kB]
Get:25 http://archive.ubuntu.com/ubuntu bionic/main amd64 libfontconfig1 amd64 2.12.6-0ubuntu2 [137 kB]
Get:26 http://archive.ubuntu.com/ubuntu bionic/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2194 B]
Get:27 http://archive.ubuntu.com/ubuntu bionic/main amd64 libjbig0 amd64 2.1-3.1build1 [26.7 kB]
Get:28 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libtiff5 amd64 4.0.9-5ubuntu0.3 [153 kB]
Get:29 http://archive.ubuntu.com/ubuntu bionic/main amd64 libwebp6 amd64 0.6.1-2 [185 kB]
Get:30 http://archive.ubuntu.com/ubuntu bionic/main amd64 libxpm4 amd64 1:3.5.12-1 [34.0 kB]
Get:31 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libgd3 amd64 2.2.5-4ubuntu0.4 [119 kB]
Get:32 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 nginx-common all 1.14.0-0ubuntu1.7 [37.4 kB]
Get:33 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnginx-mod-http-geoip amd64 1.14.0-0ubuntu1.7 [11.2 kB]
Get:34 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnginx-mod-http-image-filter amd64 1.14.0-0ubuntu1.7 [14.6 kB]
Get:35 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libxslt1.1 amd64 1.1.29-5ubuntu0.2 [150 kB]
Get:36 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnginx-mod-http-xslt-filter amd64 1.14.0-0ubuntu1.7 [13.0 kB]
Get:37 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnginx-mod-mail amd64 1.14.0-0ubuntu1.7 [41.8 kB]
Get:38 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnginx-mod-stream amd64 1.14.0-0ubuntu1.7 [63.7 kB]
Get:39 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 nginx-core amd64 1.14.0-0ubuntu1.7 [413 kB]
Get:40 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 nginx all 1.14.0-0ubuntu1.7 [3596 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 17.1 MB in 0s (40.8 MB/s)
Selecting previously unselected package multiarch-support.
(Reading database ... 4045 files and directories currently installed.)
Preparing to unpack .../multiarch-support_2.27-3ubuntu1.2_amd64.deb ...
Unpacking multiarch-support (2.27-3ubuntu1.2) ...
Setting up multiarch-support (2.27-3ubuntu1.2) ...
Selecting previously unselected package libjpeg-turbo8:amd64.
(Reading database ... 4048 files and directories currently installed.)
Preparing to unpack .../00-libjpeg-turbo8_1.5.2-0ubuntu5.18.04.4_amd64.deb ...
Unpacking libjpeg-turbo8:amd64 (1.5.2-0ubuntu5.18.04.4) ...
Selecting previously unselected package libelf1:amd64.
Preparing to unpack .../01-libelf1_0.170-0.4ubuntu0.1_amd64.deb ...
Unpacking libelf1:amd64 (0.170-0.4ubuntu0.1) ...
Selecting previously unselected package libmnl0:amd64.
Preparing to unpack .../02-libmnl0_1.0.4-2_amd64.deb ...
Unpacking libmnl0:amd64 (1.0.4-2) ...
Selecting previously unselected package iproute2.
Preparing to unpack .../03-iproute2_4.15.0-2ubuntu1.2_amd64.deb ...
Unpacking iproute2 (4.15.0-2ubuntu1.2) ...
Selecting previously unselected package libatm1:amd64.
Preparing to unpack .../04-libatm1_1%3a2.5.1-2build1_amd64.deb ...
Unpacking libatm1:amd64 (1:2.5.1-2build1) ...
Selecting previously unselected package libbsd0:amd64.
Preparing to unpack .../05-libbsd0_0.8.7-1ubuntu0.1_amd64.deb ...
Unpacking libbsd0:amd64 (0.8.7-1ubuntu0.1) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../06-libexpat1_2.2.5-3ubuntu0.2_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.5-3ubuntu0.2) ...
Selecting previously unselected package libicu60:amd64.
Preparing to unpack .../07-libicu60_60.2-3ubuntu3.1_amd64.deb ...
Unpacking libicu60:amd64 (60.2-3ubuntu3.1) ...
Selecting previously unselected package libssl1.1:amd64.
Preparing to unpack .../08-libssl1.1_1.1.1-1ubuntu2.1~18.04.6_amd64.deb ...
Unpacking libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.6) ...
Selecting previously unselected package libxml2:amd64.
Preparing to unpack .../09-libxml2_2.9.4+dfsg1-6.1ubuntu1.3_amd64.deb ...
Unpacking libxml2:amd64 (2.9.4+dfsg1-6.1ubuntu1.3) ...
Selecting previously unselected package libxtables12:amd64.
Preparing to unpack .../10-libxtables12_1.6.1-2ubuntu2_amd64.deb ...
Unpacking libxtables12:amd64 (1.6.1-2ubuntu2) ...
Selecting previously unselected package ucf.
Preparing to unpack .../11-ucf_3.0038_all.deb ...
Moving old data out of the way
Unpacking ucf (3.0038) ...
Selecting previously unselected package geoip-database.
Preparing to unpack .../12-geoip-database_20180315-1_all.deb ...
Unpacking geoip-database (20180315-1) ...
Selecting previously unselected package libgeoip1:amd64.
Preparing to unpack .../13-libgeoip1_1.6.12-1_amd64.deb ...
Unpacking libgeoip1:amd64 (1.6.12-1) ...
Selecting previously unselected package libpng16-16:amd64.
Preparing to unpack .../14-libpng16-16_1.6.34-1ubuntu0.18.04.2_amd64.deb ...
Unpacking libpng16-16:amd64 (1.6.34-1ubuntu0.18.04.2) ...
Selecting previously unselected package libxau6:amd64.
Preparing to unpack .../15-libxau6_1%3a1.0.8-1ubuntu1_amd64.deb ...
Unpacking libxau6:amd64 (1:1.0.8-1ubuntu1) ...
Selecting previously unselected package libxdmcp6:amd64.
Preparing to unpack .../16-libxdmcp6_1%3a1.1.2-3_amd64.deb ...
Unpacking libxdmcp6:amd64 (1:1.1.2-3) ...
Selecting previously unselected package libxcb1:amd64.
Preparing to unpack .../17-libxcb1_1.13-2~ubuntu18.04_amd64.deb ...
Unpacking libxcb1:amd64 (1.13-2~ubuntu18.04) ...
Selecting previously unselected package libx11-data.
Preparing to unpack .../18-libx11-data_2%3a1.6.4-3ubuntu0.3_all.deb ...
Unpacking libx11-data (2:1.6.4-3ubuntu0.3) ...
Selecting previously unselected package libx11-6:amd64.
Preparing to unpack .../19-libx11-6_2%3a1.6.4-3ubuntu0.3_amd64.deb ...
Unpacking libx11-6:amd64 (2:1.6.4-3ubuntu0.3) ...
Selecting previously unselected package fonts-dejavu-core.
Preparing to unpack .../20-fonts-dejavu-core_2.37-1_all.deb ...
Unpacking fonts-dejavu-core (2.37-1) ...
Selecting previously unselected package fontconfig-config.
Preparing to unpack .../21-fontconfig-config_2.12.6-0ubuntu2_all.deb ...
Unpacking fontconfig-config (2.12.6-0ubuntu2) ...
Selecting previously unselected package libfreetype6:amd64.
Preparing to unpack .../22-libfreetype6_2.8.1-2ubuntu2_amd64.deb ...
Unpacking libfreetype6:amd64 (2.8.1-2ubuntu2) ...
Selecting previously unselected package libfontconfig1:amd64.
Preparing to unpack .../23-libfontconfig1_2.12.6-0ubuntu2_amd64.deb ...
Unpacking libfontconfig1:amd64 (2.12.6-0ubuntu2) ...
Selecting previously unselected package libjpeg8:amd64.
Preparing to unpack .../24-libjpeg8_8c-2ubuntu8_amd64.deb ...
Unpacking libjpeg8:amd64 (8c-2ubuntu8) ...
Selecting previously unselected package libjbig0:amd64.
Preparing to unpack .../25-libjbig0_2.1-3.1build1_amd64.deb ...
Unpacking libjbig0:amd64 (2.1-3.1build1) ...
Selecting previously unselected package libtiff5:amd64.
Preparing to unpack .../26-libtiff5_4.0.9-5ubuntu0.3_amd64.deb ...
Unpacking libtiff5:amd64 (4.0.9-5ubuntu0.3) ...
Selecting previously unselected package libwebp6:amd64.
Preparing to unpack .../27-libwebp6_0.6.1-2_amd64.deb ...
Unpacking libwebp6:amd64 (0.6.1-2) ...
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack .../28-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 .../29-libgd3_2.2.5-4ubuntu0.4_amd64.deb ...
Unpacking libgd3:amd64 (2.2.5-4ubuntu0.4) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../30-nginx-common_1.14.0-0ubuntu1.7_all.deb ...
Unpacking nginx-common (1.14.0-0ubuntu1.7) ...
Selecting previously unselected package libnginx-mod-http-geoip.
Preparing to unpack .../31-libnginx-mod-http-geoip_1.14.0-0ubuntu1.7_amd64.deb ...
Unpacking libnginx-mod-http-geoip (1.14.0-0ubuntu1.7) ...
Selecting previously unselected package libnginx-mod-http-image-filter.
Preparing to unpack .../32-libnginx-mod-http-image-filter_1.14.0-0ubuntu1.7_amd64.deb ...
Unpacking libnginx-mod-http-image-filter (1.14.0-0ubuntu1.7) ...
Selecting previously unselected package libxslt1.1:amd64.
Preparing to unpack .../33-libxslt1.1_1.1.29-5ubuntu0.2_amd64.deb ...
Unpacking libxslt1.1:amd64 (1.1.29-5ubuntu0.2) ...
Selecting previously unselected package libnginx-mod-http-xslt-filter.
Preparing to unpack .../34-libnginx-mod-http-xslt-filter_1.14.0-0ubuntu1.7_amd64.deb ...
Unpacking libnginx-mod-http-xslt-filter (1.14.0-0ubuntu1.7) ...
Selecting previously unselected package libnginx-mod-mail.
Preparing to unpack .../35-libnginx-mod-mail_1.14.0-0ubuntu1.7_amd64.deb ...
Unpacking libnginx-mod-mail (1.14.0-0ubuntu1.7) ...
Selecting previously unselected package libnginx-mod-stream.
Preparing to unpack .../36-libnginx-mod-stream_1.14.0-0ubuntu1.7_amd64.deb ...
Unpacking libnginx-mod-stream (1.14.0-0ubuntu1.7) ...
Selecting previously unselected package nginx-core.
Preparing to unpack .../37-nginx-core_1.14.0-0ubuntu1.7_amd64.deb ...
Unpacking nginx-core (1.14.0-0ubuntu1.7) ...
Selecting previously unselected package nginx.
Preparing to unpack .../38-nginx_1.14.0-0ubuntu1.7_all.deb ...
Unpacking nginx (1.14.0-0ubuntu1.7) ...
Setting up libexpat1:amd64 (2.2.5-3ubuntu0.2) ...
Setting up libicu60:amd64 (60.2-3ubuntu3.1) ...
Setting up geoip-database (20180315-1) ...
Setting up libpng16-16:amd64 (1.6.34-1ubuntu0.18.04.2) ...
Setting up libjbig0:amd64 (2.1-3.1build1) ...
Setting up fonts-dejavu-core (2.37-1) ...
Setting up libelf1:amd64 (0.170-0.4ubuntu0.1) ...
Setting up nginx-common (1.14.0-0ubuntu1.7) ...
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 libjpeg-turbo8:amd64 (1.5.2-0ubuntu5.18.04.4) ...
Setting up libgeoip1:amd64 (1.6.12-1) ...
Setting up libbsd0:amd64 (0.8.7-1ubuntu0.1) ...
Setting up ucf (3.0038) ...
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 libxml2:amd64 (2.9.4+dfsg1-6.1ubuntu1.3) ...
Setting up libfreetype6:amd64 (2.8.1-2ubuntu2) ...
Setting up libxslt1.1:amd64 (1.1.29-5ubuntu0.2) ...
Setting up libatm1:amd64 (1:2.5.1-2build1) ...
Setting up libxtables12:amd64 (1.6.1-2ubuntu2) ...
Setting up libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.6) ...
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 libnginx-mod-mail (1.14.0-0ubuntu1.7) ...
Setting up libnginx-mod-http-xslt-filter (1.14.0-0ubuntu1.7) ...
Setting up libxdmcp6:amd64 (1:1.1.2-3) ...
Setting up libmnl0:amd64 (1.0.4-2) ...
Setting up libnginx-mod-http-geoip (1.14.0-0ubuntu1.7) ...
Setting up libx11-data (2:1.6.4-3ubuntu0.3) ...
Setting up libxau6:amd64 (1:1.0.8-1ubuntu1) ...
Setting up libwebp6:amd64 (0.6.1-2) ...
Setting up libjpeg8:amd64 (8c-2ubuntu8) ...
Setting up fontconfig-config (2.12.6-0ubuntu2) ...
Setting up libnginx-mod-stream (1.14.0-0ubuntu1.7) ...
Setting up libtiff5:amd64 (4.0.9-5ubuntu0.3) ...
Setting up iproute2 (4.15.0-2ubuntu1.2) ...
Setting up libxcb1:amd64 (1.13-2~ubuntu18.04) ...
Setting up libfontconfig1:amd64 (2.12.6-0ubuntu2) ...
Setting up libx11-6:amd64 (2:1.6.4-3ubuntu0.3) ...
Setting up libxpm4:amd64 (1:3.5.12-1) ...
Setting up libgd3:amd64 (2.2.5-4ubuntu0.4) ...
Setting up libnginx-mod-http-image-filter (1.14.0-0ubuntu1.7) ...
Setting up nginx-core (1.14.0-0ubuntu1.7) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up nginx (1.14.0-0ubuntu1.7) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
Removing intermediate container e8d5920132a5
 ---> 1586927b8c68
Step 5/6 : EXPOSE 80
 ---> Running in 8167f2690b28
Removing intermediate container 8167f2690b28
 ---> c510f56fd849
Step 6/6 : CMD ["nginx", "-g", "daemon off;"]
 ---> Running in 7248000129fd
Removing intermediate container 7248000129fd
 ---> b98f009c6e7c
Successfully built b98f009c6e7c
Successfully tagged nginx-demo:latest

After the build got successfully created, we can see the images into the image repository. To view the images we can fire the command, “docker images”, it will appear like shown in the below.

$ docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx-demo          latest              b98f009c6e7c        5 seconds ago       250MB
ubuntu              latest              16508e5c265d        2 years ago         84.1MB
redis               latest              4e8db158f18d        2 years ago         83.4MB
weaveworks/scope    1.9.1               4b07159e407b        2 years ago         68MB
alpine              latest              11cd0b38bc3c        2 years ago         4.41MB

If you rebuild the image for next time, then it will cache the data from it’s own repository and make the image faster.

$ docker build -t nginx-demo-new .
Sending build context to Docker daemon  2.048kB
Step 1/6 : FROM ubuntu:latest
 ---> 16508e5c265d
Step 2/6 : LABEL maintainer="learn@dockerfile.com"
 ---> Using cache
 ---> c625b767d4ad
Step 3/6 : RUN apt-get update && apt-get upgrade -y
 ---> Using cache
 ---> 538c5534dfd6
Step 4/6 : RUN apt-get install nginx -y
 ---> Using cache
 ---> 1586927b8c68
Step 5/6 : EXPOSE 80
 ---> Using cache
 ---> c510f56fd849
Step 6/6 : CMD ["nginx", "-g", "daemon off;"]
 ---> Using cache
 ---> b98f009c6e7c
Successfully built b98f009c6e7c
Successfully tagged nginx-demo-new:latest

That’s all you need to know about Dockerfile. Keep Learning.

Leave a Reply

Your email address will not be published. Required fields are marked *