docker-library / buildpack-deps

MIT License
445 stars 113 forks source link

Invalid ELF header when installing nginx in buildpack-deps:jessie #72

Closed lusid closed 6 years ago

lusid commented 6 years ago

I'm not sure what the issue is, but the following all work:

docker run -it debian:jessie /bin/sh -c "apt-get update && apt-get install -y nginx && nginx"

docker run -it buildpack-deps:jessie-curl /bin/sh -c "apt-get update && apt-get install -y nginx && nginx"

docker run -it buildpack-deps:jessie-scm /bin/sh -c "apt-get update && apt-get install -y nginx && nginx"

But this one:

docker run -it buildpack-deps:jessie /bin/sh -c "apt-get update && apt-get install -y nginx && nginx"

Displays this error at the end when trying to run nginx:

nginx: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libxml2.so.2: invalid ELF header

Any ideas? It seems like it might need a rebuild, but I'm not sure?

yosifkit commented 6 years ago

Unable to to reproduce. Sometimes images become corrupt. Have you tried deleting buildpack-deps:jessie and pulling it again?

$ docker pull buildpack-deps:jessie
jessie: Pulling from library/buildpack-deps
f49cf87b52c1: Already exists 
7b491c575b06: Already exists 
b313b08bab3b: Already exists 
51d6678c3f0e: Already exists 
Digest: sha256:dc9bf640c4a78518a269a2d22b0e1873afe183bbf315ab52bf0982d5920245d0
Status: Downloaded newer image for buildpack-deps:jessie
$ docker run -it --rm buildpack-deps:jessie /bin/sh -c "apt-get update && apt-get install -y nginx && nginx"
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://deb.debian.org jessie InRelease          
Get:2 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:3 http://deb.debian.org jessie Release.gpg [2434 B]                             
Get:4 http://deb.debian.org jessie Release [148 kB]               
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [608 kB]
Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [23.1 kB]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9064 kB]
Fetched 10.1 MB in 4s (2235 kB/s)  
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  init-system-helpers nginx-common nginx-full
Suggested packages:
  fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  init-system-helpers nginx nginx-common nginx-full
0 upgraded, 4 newly installed, 0 to remove and 18 not upgraded.
Need to get 605 kB of archives.
After this operation, 1549 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian/ jessie/main init-system-helpers all 1.22 [14.0 kB]
Get:2 http://deb.debian.org/debian/ jessie/main nginx-common all 1.6.2-5+deb8u5 [88.0 kB]
Get:3 http://deb.debian.org/debian/ jessie/main nginx-full amd64 1.6.2-5+deb8u5 [430 kB]
Get:4 http://deb.debian.org/debian/ jessie/main nginx all 1.6.2-5+deb8u5 [72.6 kB]
Fetched 605 kB in 0s (924 kB/s) 
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package init-system-helpers.
(Reading database ... 21671 files and directories currently installed.)
Preparing to unpack .../init-system-helpers_1.22_all.deb ...
Unpacking init-system-helpers (1.22) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../nginx-common_1.6.2-5+deb8u5_all.deb ...
Unpacking nginx-common (1.6.2-5+deb8u5) ...
Selecting previously unselected package nginx-full.
Preparing to unpack .../nginx-full_1.6.2-5+deb8u5_amd64.deb ...
Unpacking nginx-full (1.6.2-5+deb8u5) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.6.2-5+deb8u5_all.deb ...
Unpacking nginx (1.6.2-5+deb8u5) ...
Processing triggers for systemd (215-17+deb8u7) ...
Setting up init-system-helpers (1.22) ...
Setting up nginx-common (1.6.2-5+deb8u5) ...
debconf: unable to initialize frontend: Dialog
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: falling back to frontend: Readline
Setting up nginx-full (1.6.2-5+deb8u5) ...
invoke-rc.d: policy-rc.d denied execution of start.
Setting up nginx (1.6.2-5+deb8u5) ...
Processing triggers for systemd (215-17+deb8u7) ...
lusid commented 6 years ago

Very strange. Yeah, I get the same error:

➜  ~ docker pull buildpack-deps:jessie
jessie: Pulling from library/buildpack-deps
Digest: sha256:dc9bf640c4a78518a269a2d22b0e1873afe183bbf315ab52bf0982d5920245d0
Status: Image is up to date for buildpack-deps:jessie
➜  ~ docker run -it --rm buildpack-deps:jessie /bin/sh -c "apt-get update && apt-get install -y nginx && nginx"
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:3 http://deb.debian.org jessie Release.gpg [2434 B]
Get:4 http://deb.debian.org jessie Release [148 kB]
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [608 kB]
Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [23.1 kB]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9064 kB]
Fetched 10.1 MB in 5s (1885 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  init-system-helpers nginx-common nginx-full
Suggested packages:
  fcgiwrap nginx-doc ssl-cert
The following NEW packages will be installed:
  init-system-helpers nginx nginx-common nginx-full
0 upgraded, 4 newly installed, 0 to remove and 18 not upgraded.
Need to get 605 kB of archives.
After this operation, 1549 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian/ jessie/main init-system-helpers all 1.22 [14.0 kB]
Get:2 http://deb.debian.org/debian/ jessie/main nginx-common all 1.6.2-5+deb8u5 [88.0 kB]
Get:3 http://deb.debian.org/debian/ jessie/main nginx-full amd64 1.6.2-5+deb8u5 [430 kB]
Get:4 http://deb.debian.org/debian/ jessie/main nginx all 1.6.2-5+deb8u5 [72.6 kB]
Fetched 605 kB in 1s (468 kB/s)
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 1.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 2.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 3.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 4.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 5.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 6.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 7.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 8.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 9.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 10.
Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 11.
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package init-system-helpers.
(Reading database ... 21671 files and directories currently installed.)
Preparing to unpack .../init-system-helpers_1.22_all.deb ...
Unpacking init-system-helpers (1.22) ...
Selecting previously unselected package nginx-common.
Preparing to unpack .../nginx-common_1.6.2-5+deb8u5_all.deb ...
Unpacking nginx-common (1.6.2-5+deb8u5) ...
Selecting previously unselected package nginx-full.
Preparing to unpack .../nginx-full_1.6.2-5+deb8u5_amd64.deb ...
Unpacking nginx-full (1.6.2-5+deb8u5) ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.6.2-5+deb8u5_all.deb ...
Unpacking nginx (1.6.2-5+deb8u5) ...
Processing triggers for systemd (215-17+deb8u7) ...
Setting up init-system-helpers (1.22) ...
Setting up nginx-common (1.6.2-5+deb8u5) ...
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 1.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 2.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 3.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 4.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 5.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 6.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 7.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 8.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 9.
Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, <__ANONIO__> line 10.
Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 11.
debconf: unable to initialize frontend: Dialog
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: falling back to frontend: Readline
Setting up nginx-full (1.6.2-5+deb8u5) ...
invoke-rc.d: policy-rc.d denied execution of start.
Setting up nginx (1.6.2-5+deb8u5) ...
Processing triggers for systemd (215-17+deb8u7) ...
nginx: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libxml2.so.2: invalid ELF header
lusid commented 6 years ago

Wow, that is weird. So I completely reset my Docker environment by removing all images, and it works now. Thanks! You pushed me in the right direction.