How to Install Nginx in Linux CentOS 8 in a Docker Container

Posted on

Introduction

This is actually an article about how to install Nginx in Linux CentOS 8. Basically, Nginx is a web application server which is in the same category with the other popular type of web application such as Apache web server. It is actually very simple to install Nginx in Linux CentOS 8. But in this context, the installation of the Nginx is not in a normal server or machine. It is in a server or machine run inside a docker container.

Nginx Installation

Without further explanation, the following is the actual step of the Nginx installation in Linux CentOS 8 :

  1. First of all, just run a new container by typing the following command :

    C:\repository\project\docker>docker run -t -d --name centos_nginx centos
    8bca4865ac83972dbddb1db777059de539d76d7c862cef9d4db307cda474c5b2
    
    C:\repository\project\docker>
    
  2. After successfully running a new container, execute a command in the running container in order to be able to get in to the running docker container. The command exist in the following execution :

    C:\repository\project\docker>docker exec -it centos_nginx bash
    [root@8bca4865ac83 /]# uname -a
    Linux 8bca4865ac83 5.10.47-linuxkit #1 SMP Sat Jul 3 21:51:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    [root@8bca4865ac83 /]#
    
  3. Following after, just execute the following command to install the Nginx web application server :

    [root@8bca4865ac83 /]# cat /etc/redhat-release
    CentOS Linux release 8.4.2105
    [root@8bca4865ac83 /]# dnf install nginx
    Failed to set locale, defaulting to C.UTF-8
    CentOS Linux 8 - AppStream                                                              237 kB/s | 7.9 MB     00:34
    CentOS Linux 8 - BaseOS                                                                 583 kB/s | 2.6 MB     00:04
    CentOS Linux 8 - Extras                                                                 4.1 kB/s |  10 kB     00:02
    Dependencies resolved.
    ========================================================================================================================
     Package                            Architecture  Version                                        Repository        Size
    ========================================================================================================================
    Installing:
     nginx                              x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82         appstream        570 k
    Upgrading:
     ncurses-base                       noarch        6.1-9.20180224.el8                             baseos            81 k
     ncurses-libs                       x86_64        6.1-9.20180224.el8                             baseos           334 k
     openssl-libs                       x86_64        1:1.1.1k-4.el8                                 baseos           1.5 M
    Installing dependencies:
     dejavu-fonts-common                noarch        2.35-7.el8                                     baseos            74 k
     dejavu-sans-fonts                  noarch        2.35-7.el8                                     baseos           1.6 M
     fontconfig                         x86_64        2.13.1-4.el8                                   baseos           274 k
     fontpackages-filesystem            noarch        1.44-22.el8                                    baseos            16 k
     freetype                           x86_64        2.9.1-4.el8_3.1                                baseos           394 k
     gd                                 x86_64        2.2.5-7.el8                                    appstream        144 k
     groff-base                         x86_64        1.22.3-18.el8                                  baseos           1.0 M
     jbigkit-libs                       x86_64        2.1-14.el8                                     appstream         55 k
     libX11                             x86_64        1.6.8-5.el8                                    appstream        611 k
     libX11-common                      noarch        1.6.8-5.el8                                    appstream        158 k
     libXau                             x86_64        1.0.9-3.el8                                    appstream         37 k
     libXpm                             x86_64        3.5.12-8.el8                                   appstream         58 k
     libjpeg-turbo                      x86_64        1.5.3-12.el8                                   appstream        157 k
     libpng                             x86_64        2:1.6.34-5.el8                                 baseos           126 k
     libtiff                            x86_64        4.0.9-20.el8                                   appstream        188 k
     libwebp                            x86_64        1.0.0-5.el8                                    appstream        272 k
     libxcb                             x86_64        1.13.1-1.el8                                   appstream        229 k
     libxslt                            x86_64        1.1.32-6.el8                                   baseos           250 k
     ncurses                            x86_64        6.1-9.20180224.el8                             baseos           387 k
     nginx-all-modules                  noarch        1:1.14.1-9.module_el8.0.0+184+e34fea82         appstream         23 k
     nginx-filesystem                   noarch        1:1.14.1-9.module_el8.0.0+184+e34fea82         appstream         24 k
     nginx-mod-http-image-filter        x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82         appstream         35 k
     nginx-mod-http-perl                x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82         appstream         45 k
     nginx-mod-http-xslt-filter         x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82         appstream         33 k
     nginx-mod-mail                     x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82         appstream         64 k
     nginx-mod-stream                   x86_64        1:1.14.1-9.module_el8.0.0+184+e34fea82         appstream         85 k
     openssl                            x86_64        1:1.1.1k-4.el8                                 baseos           709 k
     perl-Carp                          noarch        1.42-396.el8                                   baseos            30 k
     perl-Data-Dumper                   x86_64        2.167-399.el8                                  baseos            58 k
     perl-Digest                        noarch        1.17-395.el8                                   appstream         27 k
     perl-Digest-MD5                    x86_64        2.55-396.el8                                   appstream         37 k
     perl-Encode                        x86_64        4:2.97-3.el8                                   baseos           1.5 M
     perl-Errno                         x86_64        1.28-420.el8                                   baseos            76 k
     perl-Exporter                      noarch        5.72-396.el8                                   baseos            34 k
     perl-File-Path                     noarch        2.15-2.el8                                     baseos            38 k
     perl-File-Temp                     noarch        0.230.600-1.el8                                baseos            63 k
     perl-Getopt-Long                   noarch        1:2.50-4.el8                                   baseos            63 k
     perl-HTTP-Tiny                     noarch        0.074-1.el8                                    baseos            58 k
     perl-IO                            x86_64        1.38-420.el8                                   baseos           142 k
     perl-MIME-Base64                   x86_64        3.15-396.el8                                   baseos            31 k
     perl-Net-SSLeay                    x86_64        1.88-1.module_el8.3.0+410+ff426aa3             appstream        379 k
     perl-PathTools                     x86_64        3.74-1.el8                                     baseos            90 k
     perl-Pod-Escapes                   noarch        1:1.07-395.el8                                 baseos            20 k
     perl-Pod-Perldoc                   noarch        3.28-396.el8                                   baseos            86 k
     perl-Pod-Simple                    noarch        1:3.35-395.el8                                 baseos           213 k
     perl-Pod-Usage                     noarch        4:1.69-395.el8                                 baseos            34 k
     perl-Scalar-List-Utils             x86_64        3:1.49-2.el8                                   baseos            68 k
     perl-Socket                        x86_64        4:2.027-3.el8                                  baseos            59 k
     perl-Storable                      x86_64        1:3.11-3.el8                                   baseos            98 k
     perl-Term-ANSIColor                noarch        4.06-396.el8                                   baseos            46 k
     perl-Term-Cap                      noarch        1.17-395.el8                                   baseos            23 k
     perl-Text-ParseWords               noarch        3.30-395.el8                                   baseos            18 k
     perl-Text-Tabs+Wrap                noarch        2013.0523-395.el8                              baseos            24 k
     perl-Time-Local                    noarch        1:1.280-1.el8                                  baseos            34 k
     perl-URI                           noarch        1.73-3.el8                                     appstream        116 k
     perl-Unicode-Normalize             x86_64        1.25-396.el8                                   baseos            82 k
     perl-constant                      noarch        1.33-396.el8                                   baseos            25 k
     perl-interpreter                   x86_64        4:5.26.3-420.el8                               baseos           6.3 M
     perl-libnet                        noarch        3.11-3.el8                                     appstream        121 k
     perl-libs                          x86_64        4:5.26.3-420.el8                               baseos           1.6 M
     perl-macros                        x86_64        4:5.26.3-420.el8                               baseos            72 k
     perl-parent                        noarch        1:0.237-1.el8                                  baseos            20 k
     perl-podlators                     noarch        4.11-1.el8                                     baseos           118 k
     perl-threads                       x86_64        1:2.21-2.el8                                   baseos            61 k
     perl-threads-shared                x86_64        1.58-2.el8                                     baseos            48 k
    Installing weak dependencies:
     openssl-pkcs11                     x86_64        0.4.10-2.el8                                   baseos            66 k
     perl-IO-Socket-IP                  noarch        0.39-5.el8                                     appstream         47 k
     perl-IO-Socket-SSL                 noarch        2.066-4.module_el8.3.0+410+ff426aa3            appstream        298 k
     perl-Mozilla-CA                    noarch        20160104-7.module_el8.3.0+416+dee7bcef         appstream         15 k
    Enabling module streams:
     nginx                                            1.14
     perl                                             5.26
     perl-IO-Socket-SSL                               2.066
     perl-libwww-perl                                 6.34
    
    Transaction Summary
    ========================================================================================================================
    Install  70 Packages
    Upgrade   3 Packages
    
    Total download size: 22 M
    Is this ok [y/N]: y
    Downloading Packages:
    CentOS Linux 8 - AppStream              196% [==========================================================================(1/73): jbigkit-libs-2.1-14.el8.x86_64.rpm                                              654 kB/s |  55 kB     00:00
    (2/73): gd-2.2.5-7.el8.x86_64.rpm                                                       1.5 MB/s | 144 kB     00:00
    (3/73): libXau-1.0.9-3.el8.x86_64.rpm                                                   261 kB/s |  37 kB     00:00
    (4/73): libXpm-3.5.12-8.el8.x86_64.rpm                                                  429 kB/s |  58 kB     00:00
    (5/73): libX11-common-1.6.8-5.el8.noarch.rpm                                            488 kB/s | 158 kB     00:00
    (6/73): libjpeg-turbo-1.5.3-12.el8.x86_64.rpm                                           447 kB/s | 157 kB     00:00
    (7/73): libtiff-4.0.9-20.el8.x86_64.rpm                                                 381 kB/s | 188 kB     00:00
    (8/73): libX11-1.6.8-5.el8.x86_64.rpm                                                   406 kB/s | 611 kB     00:01
    (9/73): libxcb-1.13.1-1.el8.x86_64.rpm                                                  238 kB/s | 229 kB     00:00
    (10/73): libwebp-1.0.0-5.el8.x86_64.rpm                                                 222 kB/s | 272 kB     00:01
    (11/73): nginx-all-modules-1.14.1-9.module_el8.0.0+184+e34fea82.noarch.rpm               95 kB/s |  23 kB     00:00
    (12/73): nginx-filesystem-1.14.1-9.module_el8.0.0+184+e34fea82.noarch.rpm               120 kB/s |  24 kB     00:00
    (13/73): nginx-mod-http-image-filter-1.14.1-9.module_el8.0.0+184+e34fea82.x86_64.rpm    155 kB/s |  35 kB     00:00
    (14/73): nginx-mod-http-perl-1.14.1-9.module_el8.0.0+184+e34fea82.x86_64.rpm            168 kB/s |  45 kB     00:00
    (15/73): nginx-mod-http-xslt-filter-1.14.1-9.module_el8.0.0+184+e34fea82.x86_64.rpm     174 kB/s |  33 kB     00:00
    (16/73): nginx-1.14.1-9.module_el8.0.0+184+e34fea82.x86_64.rpm                          499 kB/s | 570 kB     00:01
    (17/73): nginx-mod-mail-1.14.1-9.module_el8.0.0+184+e34fea82.x86_64.rpm                 278 kB/s |  64 kB     00:00
    (18/73): nginx-mod-stream-1.14.1-9.module_el8.0.0+184+e34fea82.x86_64.rpm               491 kB/s |  85 kB     00:00
    (19/73): perl-Digest-1.17-395.el8.noarch.rpm                                            304 kB/s |  27 kB     00:00
    (20/73): perl-Digest-MD5-2.55-396.el8.x86_64.rpm                                        254 kB/s |  37 kB     00:00
    (21/73): perl-IO-Socket-IP-0.39-5.el8.noarch.rpm                                        300 kB/s |  47 kB     00:00
    (22/73): perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch.rpm              103 kB/s |  15 kB     00:00
    (23/73): perl-URI-1.73-3.el8.noarch.rpm                                                 367 kB/s | 116 kB     00:00
    (24/73): perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch.rpm              484 kB/s | 298 kB     00:00
    (25/73): perl-libnet-3.11-3.el8.noarch.rpm                                              430 kB/s | 121 kB     00:00
    (26/73): perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64.rpm                  527 kB/s | 379 kB     00:00
    (27/73): dejavu-fonts-common-2.35-7.el8.noarch.rpm                                       41 kB/s |  74 kB     00:01
    (28/73): fontpackages-filesystem-1.44-22.el8.noarch.rpm                                 145 kB/s |  16 kB     00:00
    (29/73): fontconfig-2.13.1-4.el8.x86_64.rpm                                             121 kB/s | 274 kB     00:02
    (30/73): freetype-2.9.1-4.el8_3.1.x86_64.rpm                                            294 kB/s | 394 kB     00:01
    (31/73): libpng-1.6.34-5.el8.x86_64.rpm                                                 236 kB/s | 126 kB     00:00
    (32/73): libxslt-1.1.32-6.el8.x86_64.rpm                                                390 kB/s | 250 kB     00:00
    (33/73): ncurses-6.1-9.20180224.el8.x86_64.rpm                                          485 kB/s | 387 kB     00:00
    (34/73): groff-base-1.22.3-18.el8.x86_64.rpm                                            356 kB/s | 1.0 MB     00:02
    (35/73): dejavu-sans-fonts-2.35-7.el8.noarch.rpm                                        305 kB/s | 1.6 MB     00:05
    (36/73): openssl-pkcs11-0.4.10-2.el8.x86_64.rpm                                          57 kB/s |  66 kB     00:01
    (37/73): perl-Carp-1.42-396.el8.noarch.rpm                                               26 kB/s |  30 kB     00:01
    (38/73): perl-Data-Dumper-2.167-399.el8.x86_64.rpm                                      678 kB/s |  58 kB     00:00
    (39/73): perl-Errno-1.28-420.el8.x86_64.rpm                                             602 kB/s |  76 kB     00:00
    (40/73): perl-Exporter-5.72-396.el8.noarch.rpm                                          253 kB/s |  34 kB     00:00
    (41/73): openssl-1.1.1k-4.el8.x86_64.rpm                                                424 kB/s | 709 kB     00:01
    (42/73): perl-File-Path-2.15-2.el8.noarch.rpm                                           544 kB/s |  38 kB     00:00
    (43/73): perl-File-Temp-0.230.600-1.el8.noarch.rpm                                      261 kB/s |  63 kB     00:00
    (44/73): perl-Getopt-Long-2.50-4.el8.noarch.rpm                                         341 kB/s |  63 kB     00:00
    (45/73): perl-HTTP-Tiny-0.074-1.el8.noarch.rpm                                          377 kB/s |  58 kB     00:00
    (46/73): perl-MIME-Base64-3.15-396.el8.x86_64.rpm                                       255 kB/s |  31 kB     00:00
    (47/73): perl-IO-1.38-420.el8.x86_64.rpm                                                468 kB/s | 142 kB     00:00
    (48/73): perl-Pod-Escapes-1.07-395.el8.noarch.rpm                                       222 kB/s |  20 kB     00:00
    (49/73): perl-PathTools-3.74-1.el8.x86_64.rpm                                           303 kB/s |  90 kB     00:00
    (50/73): perl-Pod-Perldoc-3.28-396.el8.noarch.rpm                                       403 kB/s |  86 kB     00:00
    (51/73): perl-Pod-Usage-1.69-395.el8.noarch.rpm                                         315 kB/s |  34 kB     00:00
    (52/73): perl-Scalar-List-Utils-1.49-2.el8.x86_64.rpm                                   267 kB/s |  68 kB     00:00
    (53/73): perl-Pod-Simple-3.35-395.el8.noarch.rpm                                        403 kB/s | 213 kB     00:00
    (54/73): perl-Storable-3.11-3.el8.x86_64.rpm                                             85 kB/s |  98 kB     00:01
    (55/73): perl-Socket-2.027-3.el8.x86_64.rpm                                              46 kB/s |  59 kB     00:01
    (56/73): perl-Term-Cap-1.17-395.el8.noarch.rpm                                          356 kB/s |  23 kB     00:00
    (57/73): perl-Term-ANSIColor-4.06-396.el8.noarch.rpm                                    433 kB/s |  46 kB     00:00
    (58/73): perl-Text-ParseWords-3.30-395.el8.noarch.rpm                                   299 kB/s |  18 kB     00:00
    (59/73): perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch.rpm                               448 kB/s |  24 kB     00:00
    (60/73): perl-Time-Local-1.280-1.el8.noarch.rpm                                         637 kB/s |  34 kB     00:00
    (61/73): perl-constant-1.33-396.el8.noarch.rpm                                          249 kB/s |  25 kB     00:00
    (62/73): perl-Encode-2.97-3.el8.x86_64.rpm                                              490 kB/s | 1.5 MB     00:03
    (63/73): perl-Unicode-Normalize-1.25-396.el8.x86_64.rpm                                 278 kB/s |  82 kB     00:00
    (64/73): perl-macros-5.26.3-420.el8.x86_64.rpm                                          167 kB/s |  72 kB     00:00
    (65/73): perl-parent-0.237-1.el8.noarch.rpm                                              68 kB/s |  20 kB     00:00
    (66/73): perl-podlators-4.11-1.el8.noarch.rpm                                           219 kB/s | 118 kB     00:00
    (67/73): perl-threads-2.21-2.el8.x86_64.rpm                                             210 kB/s |  61 kB     00:00
    (68/73): perl-threads-shared-1.58-2.el8.x86_64.rpm                                      180 kB/s |  48 kB     00:00
    (69/73): ncurses-base-6.1-9.20180224.el8.noarch.rpm                                     208 kB/s |  81 kB     00:00
    (70/73): perl-libs-5.26.3-420.el8.x86_64.rpm                                            565 kB/s | 1.6 MB     00:02
    (71/73): ncurses-libs-6.1-9.20180224.el8.x86_64.rpm                                     175 kB/s | 334 kB     00:01
    (72/73): openssl-libs-1.1.1k-4.el8.x86_64.rpm                                           575 kB/s | 1.5 MB     00:02
    (73/73): perl-interpreter-5.26.3-420.el8.x86_64.rpm                                     734 kB/s | 6.3 MB     00:08
    ------------------------------------------------------------------------------------------------------------------------
    Total                                                                                   964 kB/s |  22 MB     00:22
    warning: /var/cache/dnf/appstream-02e86d1c976ab532/packages/gd-2.2.5-7.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
    CentOS Linux 8 - AppStream                                                              1.6 MB/s | 1.6 kB     00:00
    Importing GPG key 0x8483C65D:
     Userid     : "CentOS (CentOS Official Signing Key) <security@centos.org>"
     Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
    Is this ok [y/N]: y
    Key imported successfully
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Preparing        :                                                                                                1/1
      Upgrading        : openssl-libs-1:1.1.1k-4.el8.x86_64                                                            1/76
      Running scriptlet: openssl-libs-1:1.1.1k-4.el8.x86_64                                                            1/76
      Installing       : openssl-1:1.1.1k-4.el8.x86_64                                                                 2/76
      Installing       : openssl-pkcs11-0.4.10-2.el8.x86_64                                                            3/76
      Installing       : libpng-2:1.6.34-5.el8.x86_64                                                                  4/76
      Installing       : freetype-2.9.1-4.el8_3.1.x86_64                                                               5/76
      Installing       : fontpackages-filesystem-1.44-22.el8.noarch                                                    6/76
      Installing       : libjpeg-turbo-1.5.3-12.el8.x86_64                                                             7/76
      Installing       : dejavu-fonts-common-2.35-7.el8.noarch                                                         8/76
      Installing       : dejavu-sans-fonts-2.35-7.el8.noarch                                                           9/76
      Installing       : fontconfig-2.13.1-4.el8.x86_64                                                               10/76
      Running scriptlet: fontconfig-2.13.1-4.el8.x86_64                                                               10/76
      Upgrading        : ncurses-base-6.1-9.20180224.el8.noarch                                                       11/76
      Upgrading        : ncurses-libs-6.1-9.20180224.el8.x86_64                                                       12/76
      Installing       : ncurses-6.1-9.20180224.el8.x86_64                                                            13/76
      Installing       : libxslt-1.1.32-6.el8.x86_64                                                                  14/76
      Installing       : groff-base-1.22.3-18.el8.x86_64                                                              15/76
      Installing       : perl-Digest-1.17-395.el8.noarch                                                              16/76
      Installing       : perl-Digest-MD5-2.55-396.el8.x86_64                                                          17/76
      Installing       : perl-Data-Dumper-2.167-399.el8.x86_64                                                        18/76
      Installing       : perl-libnet-3.11-3.el8.noarch                                                                19/76
      Installing       : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64                                    20/76
      Installing       : perl-URI-1.73-3.el8.noarch                                                                   21/76
      Installing       : perl-Pod-Escapes-1:1.07-395.el8.noarch                                                       22/76
      Installing       : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch                                23/76
      Installing       : perl-IO-Socket-IP-0.39-5.el8.noarch                                                          24/76
      Installing       : perl-Time-Local-1:1.280-1.el8.noarch                                                         25/76
      Installing       : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch                                26/76
      Installing       : perl-Term-ANSIColor-4.06-396.el8.noarch                                                      27/76
      Installing       : perl-Term-Cap-1.17-395.el8.noarch                                                            28/76
      Installing       : perl-File-Temp-0.230.600-1.el8.noarch                                                        29/76
      Installing       : perl-Pod-Simple-1:3.35-395.el8.noarch                                                        30/76
      Installing       : perl-HTTP-Tiny-0.074-1.el8.noarch                                                            31/76
      Installing       : perl-podlators-4.11-1.el8.noarch                                                             32/76
      Installing       : perl-Pod-Perldoc-3.28-396.el8.noarch                                                         33/76
      Installing       : perl-Text-ParseWords-3.30-395.el8.noarch                                                     34/76
      Installing       : perl-Pod-Usage-4:1.69-395.el8.noarch                                                         35/76
      Installing       : perl-MIME-Base64-3.15-396.el8.x86_64                                                         36/76
      Installing       : perl-Storable-1:3.11-3.el8.x86_64                                                            37/76
      Installing       : perl-Getopt-Long-1:2.50-4.el8.noarch                                                         38/76
      Installing       : perl-Errno-1.28-420.el8.x86_64                                                               39/76
      Installing       : perl-Socket-4:2.027-3.el8.x86_64                                                             40/76
      Installing       : perl-Encode-4:2.97-3.el8.x86_64                                                              41/76
      Installing       : perl-Carp-1.42-396.el8.noarch                                                                42/76
      Installing       : perl-Exporter-5.72-396.el8.noarch                                                            43/76
      Installing       : perl-libs-4:5.26.3-420.el8.x86_64                                                            44/76
      Installing       : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64                                                   45/76
      Installing       : perl-parent-1:0.237-1.el8.noarch                                                             46/76
      Installing       : perl-macros-4:5.26.3-420.el8.x86_64                                                          47/76
      Installing       : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch                                                 48/76
      Installing       : perl-Unicode-Normalize-1.25-396.el8.x86_64                                                   49/76
      Installing       : perl-File-Path-2.15-2.el8.noarch                                                             50/76
      Installing       : perl-IO-1.38-420.el8.x86_64                                                                  51/76
      Installing       : perl-PathTools-3.74-1.el8.x86_64                                                             52/76
      Installing       : perl-constant-1.33-396.el8.noarch                                                            53/76
      Installing       : perl-threads-1:2.21-2.el8.x86_64                                                             54/76
      Installing       : perl-threads-shared-1.58-2.el8.x86_64                                                        55/76
      Installing       : perl-interpreter-4:5.26.3-420.el8.x86_64                                                     56/76
      Running scriptlet: nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch                               57/76
      Installing       : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch                               57/76
      Installing       : libwebp-1.0.0-5.el8.x86_64                                                                   58/76
      Installing       : libXau-1.0.9-3.el8.x86_64                                                                    59/76
      Installing       : libxcb-1.13.1-1.el8.x86_64                                                                   60/76
      Installing       : libX11-common-1.6.8-5.el8.noarch                                                             61/76
      Installing       : libX11-1.6.8-5.el8.x86_64                                                                    62/76
      Installing       : libXpm-3.5.12-8.el8.x86_64                                                                   63/76
      Installing       : jbigkit-libs-2.1-14.el8.x86_64                                                               64/76
      Running scriptlet: jbigkit-libs-2.1-14.el8.x86_64                                                               64/76
      Installing       : libtiff-4.0.9-20.el8.x86_64                                                                  65/76
      Installing       : gd-2.2.5-7.el8.x86_64                                                                        66/76
      Running scriptlet: gd-2.2.5-7.el8.x86_64                                                                        66/76
      Installing       : nginx-mod-http-perl-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                            67/76
      Running scriptlet: nginx-mod-http-perl-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                            67/76
      Installing       : nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                     68/76
      Running scriptlet: nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                     68/76
      Installing       : nginx-mod-mail-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                                 69/76
      Running scriptlet: nginx-mod-mail-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                                 69/76
      Installing       : nginx-mod-stream-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                               70/76
      Running scriptlet: nginx-mod-stream-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                               70/76
      Installing       : nginx-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                                          71/76
      Running scriptlet: nginx-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                                          71/76
      Installing       : nginx-mod-http-image-filter-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                    72/76
      Running scriptlet: nginx-mod-http-image-filter-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                    72/76
      Installing       : nginx-all-modules-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch                              73/76
      Cleanup          : ncurses-libs-6.1-7.20180224.el8.x86_64                                                       74/76
      Cleanup          : ncurses-base-6.1-7.20180224.el8.noarch                                                       75/76
      Cleanup          : openssl-libs-1:1.1.1g-15.el8_3.x86_64                                                        76/76
      Running scriptlet: openssl-libs-1:1.1.1g-15.el8_3.x86_64                                                        76/76
      Running scriptlet: fontconfig-2.13.1-4.el8.x86_64                                                               76/76
      Verifying        : gd-2.2.5-7.el8.x86_64                                                                         1/76
      Verifying        : jbigkit-libs-2.1-14.el8.x86_64                                                                2/76
      Verifying        : libX11-1.6.8-5.el8.x86_64                                                                     3/76
      Verifying        : libX11-common-1.6.8-5.el8.noarch                                                              4/76
      Verifying        : libXau-1.0.9-3.el8.x86_64                                                                     5/76
      Verifying        : libXpm-3.5.12-8.el8.x86_64                                                                    6/76
      Verifying        : libjpeg-turbo-1.5.3-12.el8.x86_64                                                             7/76
      Verifying        : libtiff-4.0.9-20.el8.x86_64                                                                   8/76
      Verifying        : libwebp-1.0.0-5.el8.x86_64                                                                    9/76
      Verifying        : libxcb-1.13.1-1.el8.x86_64                                                                   10/76
      Verifying        : nginx-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                                          11/76
      Verifying        : nginx-all-modules-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch                              12/76
      Verifying        : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch                               13/76
      Verifying        : nginx-mod-http-image-filter-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                    14/76
      Verifying        : nginx-mod-http-perl-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                            15/76
      Verifying        : nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                     16/76
      Verifying        : nginx-mod-mail-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                                 17/76
      Verifying        : nginx-mod-stream-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64                               18/76
      Verifying        : perl-Digest-1.17-395.el8.noarch                                                              19/76
      Verifying        : perl-Digest-MD5-2.55-396.el8.x86_64                                                          20/76
      Verifying        : perl-IO-Socket-IP-0.39-5.el8.noarch                                                          21/76
      Verifying        : perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch                                22/76
      Verifying        : perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch                                23/76
      Verifying        : perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64                                    24/76
      Verifying        : perl-URI-1.73-3.el8.noarch                                                                   25/76
      Verifying        : perl-libnet-3.11-3.el8.noarch                                                                26/76
      Verifying        : dejavu-fonts-common-2.35-7.el8.noarch                                                        27/76
      Verifying        : dejavu-sans-fonts-2.35-7.el8.noarch                                                          28/76
      Verifying        : fontconfig-2.13.1-4.el8.x86_64                                                               29/76
      Verifying        : fontpackages-filesystem-1.44-22.el8.noarch                                                   30/76
      Verifying        : freetype-2.9.1-4.el8_3.1.x86_64                                                              31/76
      Verifying        : groff-base-1.22.3-18.el8.x86_64                                                              32/76
      Verifying        : libpng-2:1.6.34-5.el8.x86_64                                                                 33/76
      Verifying        : libxslt-1.1.32-6.el8.x86_64                                                                  34/76
      Verifying        : ncurses-6.1-9.20180224.el8.x86_64                                                            35/76
      Verifying        : openssl-1:1.1.1k-4.el8.x86_64                                                                36/76
      Verifying        : openssl-pkcs11-0.4.10-2.el8.x86_64                                                           37/76
      Verifying        : perl-Carp-1.42-396.el8.noarch                                                                38/76
      Verifying        : perl-Data-Dumper-2.167-399.el8.x86_64                                                        39/76
      Verifying        : perl-Encode-4:2.97-3.el8.x86_64                                                              40/76
      Verifying        : perl-Errno-1.28-420.el8.x86_64                                                               41/76
      Verifying        : perl-Exporter-5.72-396.el8.noarch                                                            42/76
      Verifying        : perl-File-Path-2.15-2.el8.noarch                                                             43/76
      Verifying        : perl-File-Temp-0.230.600-1.el8.noarch                                                        44/76
      Verifying        : perl-Getopt-Long-1:2.50-4.el8.noarch                                                         45/76
      Verifying        : perl-HTTP-Tiny-0.074-1.el8.noarch                                                            46/76
      Verifying        : perl-IO-1.38-420.el8.x86_64                                                                  47/76
      Verifying        : perl-MIME-Base64-3.15-396.el8.x86_64                                                         48/76
      Verifying        : perl-PathTools-3.74-1.el8.x86_64                                                             49/76
      Verifying        : perl-Pod-Escapes-1:1.07-395.el8.noarch                                                       50/76
      Verifying        : perl-Pod-Perldoc-3.28-396.el8.noarch                                                         51/76
      Verifying        : perl-Pod-Simple-1:3.35-395.el8.noarch                                                        52/76
      Verifying        : perl-Pod-Usage-4:1.69-395.el8.noarch                                                         53/76
      Verifying        : perl-Scalar-List-Utils-3:1.49-2.el8.x86_64                                                   54/76
      Verifying        : perl-Socket-4:2.027-3.el8.x86_64                                                             55/76
      Verifying        : perl-Storable-1:3.11-3.el8.x86_64                                                            56/76
      Verifying        : perl-Term-ANSIColor-4.06-396.el8.noarch                                                      57/76
      Verifying        : perl-Term-Cap-1.17-395.el8.noarch                                                            58/76
      Verifying        : perl-Text-ParseWords-3.30-395.el8.noarch                                                     59/76
      Verifying        : perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch                                                 60/76
      Verifying        : perl-Time-Local-1:1.280-1.el8.noarch                                                         61/76
      Verifying        : perl-Unicode-Normalize-1.25-396.el8.x86_64                                                   62/76
      Verifying        : perl-constant-1.33-396.el8.noarch                                                            63/76
      Verifying        : perl-interpreter-4:5.26.3-420.el8.x86_64                                                     64/76
      Verifying        : perl-libs-4:5.26.3-420.el8.x86_64                                                            65/76
      Verifying        : perl-macros-4:5.26.3-420.el8.x86_64                                                          66/76
      Verifying        : perl-parent-1:0.237-1.el8.noarch                                                             67/76
      Verifying        : perl-podlators-4.11-1.el8.noarch                                                             68/76
      Verifying        : perl-threads-1:2.21-2.el8.x86_64                                                             69/76
      Verifying        : perl-threads-shared-1.58-2.el8.x86_64                                                        70/76
      Verifying        : ncurses-base-6.1-9.20180224.el8.noarch                                                       71/76
      Verifying        : ncurses-base-6.1-7.20180224.el8.noarch                                                       72/76
      Verifying        : ncurses-libs-6.1-9.20180224.el8.x86_64                                                       73/76
      Verifying        : ncurses-libs-6.1-7.20180224.el8.x86_64                                                       74/76
      Verifying        : openssl-libs-1:1.1.1k-4.el8.x86_64                                                           75/76
      Verifying        : openssl-libs-1:1.1.1g-15.el8_3.x86_64                                                        76/76
    
    Upgraded:
      ncurses-base-6.1-9.20180224.el8.noarch   ncurses-libs-6.1-9.20180224.el8.x86_64   openssl-libs-1:1.1.1k-4.el8.x86_64
    Installed:
      dejavu-fonts-common-2.35-7.el8.noarch
      dejavu-sans-fonts-2.35-7.el8.noarch
      fontconfig-2.13.1-4.el8.x86_64
      fontpackages-filesystem-1.44-22.el8.noarch
      freetype-2.9.1-4.el8_3.1.x86_64
      gd-2.2.5-7.el8.x86_64
      groff-base-1.22.3-18.el8.x86_64
      jbigkit-libs-2.1-14.el8.x86_64
      libX11-1.6.8-5.el8.x86_64
      libX11-common-1.6.8-5.el8.noarch
      libXau-1.0.9-3.el8.x86_64
      libXpm-3.5.12-8.el8.x86_64
      libjpeg-turbo-1.5.3-12.el8.x86_64
      libpng-2:1.6.34-5.el8.x86_64
      libtiff-4.0.9-20.el8.x86_64
      libwebp-1.0.0-5.el8.x86_64
      libxcb-1.13.1-1.el8.x86_64
      libxslt-1.1.32-6.el8.x86_64
      ncurses-6.1-9.20180224.el8.x86_64
      nginx-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64
      nginx-all-modules-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch
      nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch
      nginx-mod-http-image-filter-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64
      nginx-mod-http-perl-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64
      nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64
      nginx-mod-mail-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64
      nginx-mod-stream-1:1.14.1-9.module_el8.0.0+184+e34fea82.x86_64
      openssl-1:1.1.1k-4.el8.x86_64
      openssl-pkcs11-0.4.10-2.el8.x86_64
      perl-Carp-1.42-396.el8.noarch
      perl-Data-Dumper-2.167-399.el8.x86_64
      perl-Digest-1.17-395.el8.noarch
      perl-Digest-MD5-2.55-396.el8.x86_64
      perl-Encode-4:2.97-3.el8.x86_64
      perl-Errno-1.28-420.el8.x86_64
      perl-Exporter-5.72-396.el8.noarch
      perl-File-Path-2.15-2.el8.noarch
      perl-File-Temp-0.230.600-1.el8.noarch
      perl-Getopt-Long-1:2.50-4.el8.noarch
      perl-HTTP-Tiny-0.074-1.el8.noarch
      perl-IO-1.38-420.el8.x86_64
      perl-IO-Socket-IP-0.39-5.el8.noarch
      perl-IO-Socket-SSL-2.066-4.module_el8.3.0+410+ff426aa3.noarch
      perl-MIME-Base64-3.15-396.el8.x86_64
      perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch
      perl-Net-SSLeay-1.88-1.module_el8.3.0+410+ff426aa3.x86_64
      perl-PathTools-3.74-1.el8.x86_64
      perl-Pod-Escapes-1:1.07-395.el8.noarch
      perl-Pod-Perldoc-3.28-396.el8.noarch
      perl-Pod-Simple-1:3.35-395.el8.noarch
      perl-Pod-Usage-4:1.69-395.el8.noarch
      perl-Scalar-List-Utils-3:1.49-2.el8.x86_64
      perl-Socket-4:2.027-3.el8.x86_64
      perl-Storable-1:3.11-3.el8.x86_64
      perl-Term-ANSIColor-4.06-396.el8.noarch
      perl-Term-Cap-1.17-395.el8.noarch
      perl-Text-ParseWords-3.30-395.el8.noarch
      perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch
      perl-Time-Local-1:1.280-1.el8.noarch
      perl-URI-1.73-3.el8.noarch
      perl-Unicode-Normalize-1.25-396.el8.x86_64
      perl-constant-1.33-396.el8.noarch
      perl-interpreter-4:5.26.3-420.el8.x86_64
      perl-libnet-3.11-3.el8.noarch
      perl-libs-4:5.26.3-420.el8.x86_64
      perl-macros-4:5.26.3-420.el8.x86_64
      perl-parent-1:0.237-1.el8.noarch
      perl-podlators-4.11-1.el8.noarch
      perl-threads-1:2.21-2.el8.x86_64
      perl-threads-shared-1.58-2.el8.x86_64
    
    Complete!
    [root@8bca4865ac83 /]# 
    
  4. Last but not least just enable it. But the service cannot start normally from inside the container. Just run it once more from outside of the container. The following is an attempt to enable and start nginx from inside the container :

    [root@8bca4865ac83 /]# systemctl enable nginx
    Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
    [root@8bca4865ac83 /]# systemctl start nginx
    System has not been booted with systemd as init system (PID 1). Can't operate.
    Failed to connect to bus: Host is down
    [root@8bca4865ac83 /]#
    

Leave a Reply