docker-library / buildpack-deps

MIT License
450 stars 115 forks source link

... "is not an ELF file" #74

Closed jherdman closed 6 years ago

jherdman commented 6 years ago

Using this simple Dockerfile:

FROM buildpack-deps:stretch

RUN ldconfig

I see the following output:

Step 1/2 : FROM buildpack-deps:stretch
stretch: Pulling from library/buildpack-deps
c73ab1c6897b: Already exists
1ab373b3deae: Already exists
b542772b4177: Already exists
57c8de432dbe: Already exists
1785850988c5: Already exists
Digest: sha256:889af006b4464deb95e123a47b014b68a0566bf4c21def0d0d137166d6892834
Status: Downloaded newer image for buildpack-deps:stretch
 ---> d63e05ca3eba
Step 2/2 : RUN ldconfig
 ---> Running in 92e4fef4f202
ldconfig: /usr/lib/x86_64-linux-gnu/libmpc.so.3.0.0 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libmagic.so.1 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libmagic.so.1.0.0 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libpthread.so is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libmpfr.so.4.1.5 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libsigsegv.so.2.0.3 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libopenjp2.so.7 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libmpc.so.3 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libxml2.so is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libopenjp2.so is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libmpfr.so.4 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libxml2.so.2 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libsigsegv.so.2 is not an ELF file - it has the wrong magic bytes at the start.

ldconfig: /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2 is not an ELF file - it has the wrong magic bytes at the start.

Removing intermediate container 92e4fef4f202
 ---> 69cf2f0a27c7
Successfully built 69cf2f0a27c7
Successfully tagged huh:latest

I ran into this problem when trying to build a C extension for bcrypt_elixir that relies upon this image. Here's it error output:

Step 8/8 : RUN cd deps/bcrypt_elixir && make clean && make
 ---> Running in 6ac9610fb466
rm -f priv/bcrypt_nif.so
mkdir -p priv
cc -g -O3 -Wall -I/usr/local/lib/erlang/erts-9.3/include -Ic_src -fPIC -shared  c_src/bcrypt_nif.c c_src/blowfish.c -o priv/bcrypt_nif.so
/usr/lib/gcc/x86_64-linux-gnu/6/cc1: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libmpc.so.3: invalid ELF header
/usr/lib/gcc/x86_64-linux-gnu/6/cc1: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libmpc.so.3: invalid ELF header
Makefile:29: recipe for target 'priv/bcrypt_nif.so' failed
make: *** [priv/bcrypt_nif.so] Error 1
The command '/bin/sh -c cd deps/bcrypt_elixir && make clean && make' returned a non-zero code: 2

Here are some details about my system:

screen shot 2018-03-18 at 10 18 15 pm
yosifkit commented 6 years ago

I am unable to reproduce. Probably corrupt images. Try deleting them completely and pulling them again.

See also, https://github.com/docker/for-mac/issues/2327 (https://github.com/docker-library/openjdk/issues/169, https://github.com/docker-library/ruby/issues/180, https://github.com/docker-library/mysql/issues/372, https://github.com/docker/for-mac/issues/2542, https://github.com/docker-library/python/issues/260, https://github.com/docker-library/php/issues/594, https://github.com/docker-library/ruby/issues/195, https://github.com/docker-library/mongo/issues/251, https://github.com/docker-library/php/issues/599).

$ docker pull buildpack-deps:stretch
stretch: Pulling from library/buildpack-deps
c73ab1c6897b: Pull complete 
1ab373b3deae: Pull complete 
b542772b4177: Pull complete 
57c8de432dbe: Pull complete 
1785850988c5: Pull complete 
Digest: sha256:889af006b4464deb95e123a47b014b68a0566bf4c21def0d0d137166d6892834
Status: Downloaded newer image for buildpack-deps:stretch
$ docker run -it --rm buildpack-deps:stretch
root@2c68729315d8:/# ldconfig
root@2c68729315d8:/# exit
jherdman commented 6 years ago

Confirmed. Many thanks for taking the time to look into this.