Error installing Nginx on Docker

Asked

Viewed 77 times

1

When I install Nginx on Docker, the error below occurs and Nginx does not start. I was not having this problem before. You’ve been through it?

Follow below the procedure I follow:

Versão do S.O 
CentOS Linux release 7.6.1810 (Core)

Installation of the Docker

# yum install yum-utils device-mapper-persistent-data lvm2 -y
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# yum install docker-ce

Downloading image of Ubuntu

# docker pull ubuntu
# docker run -i -t ubuntu bash
# apt-get update

  Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
  Get:2 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [4171 B]
  Get:3 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [426 kB]

# apt-get install nginx
  debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. 
    at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)

  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: (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.)

  Setting up libnginx-mod-http-image-filter (1.14.0-0ubuntu1.2) ...
  Setting up nginx-core (1.14.0-0ubuntu1.2) ...
  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.2) ...
  Processing triggers for libc-bin (2.27-3ubuntu1) ...

# /etc/init.d/nginx start
  * Starting nginx nginx  [fail]
  • 1

    Alex, the way you’re doing it isn’t ideal, you could just pull the official Nginx image (docker pull nginx)

  • First, why are you running the Centos system and then Ubuntu? An alternative that can solve the problem debconf is after the following lines, # docker pull ubuntu # docker run -i -t ubuntu bash # apt-get update, include the line apt-get install dialog

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.