Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build fails with "ELF: not found" #13055

Closed
SaraSmiseth opened this issue Feb 9, 2020 · 5 comments
Closed

Docker build fails with "ELF: not found" #13055

SaraSmiseth opened this issue Feb 9, 2020 · 5 comments

Comments

@SaraSmiseth
Copy link
Contributor

Expected behaviour

"docker build ." should build the image.

Actual behaviour

Running "docker build ." gives the following error:

Sending build context to Docker daemon  152.8MB
Step 1/39 : FROM ubuntu:18.04 as build-dep
 ---> 240a3b1be63a
Step 2/39 : SHELL ["bash", "-c"]
 ---> Using cache
 ---> c1302df6f090
Step 3/39 : ENV NODE_VER="12.14.0"
 ---> Using cache
 ---> e5d2f513fbf5
Step 4/39 : RUN	echo "Etc/UTC" > /etc/localtime && 	apt update && 	apt -y install wget python && 	cd ~ && 	wget https://nodejs.org/download/release/v$NODE_VER/node-v$NODE_VER-linux-x64.tar.gz && 	tar xf node-v$NODE_VER-linux-x64.tar.gz && 	rm node-v$NODE_VER-linux-x64.tar.gz && 	mv node-v$NODE_VER-linux-x64 /opt/node
 ---> Using cache
 ---> acbdd89cc7bd
Step 5/39 : ENV JE_VER="5.2.1"
 ---> Using cache
 ---> 489898782990
Step 6/39 : RUN apt update && 	apt -y install make autoconf gcc g++ && 	cd ~ && 	wget https://github.com/jemalloc/jemalloc/archive/$JE_VER.tar.gz && 	tar xf $JE_VER.tar.gz && 	cd jemalloc-$JE_VER && 	./autogen.sh && 	./configure --prefix=/opt/jemalloc && 	make -j$(nproc) > /dev/null && 	make install_bin install_include install_lib
 ---> Using cache
 ---> 4c4165580ba8
Step 7/39 : ENV RUBY_VER="2.6.5"
 ---> Using cache
 ---> db36466301fd
Step 8/39 : ENV CPPFLAGS="-I/opt/jemalloc/include"
 ---> Using cache
 ---> aa0ecb5c7ca5
Step 9/39 : ENV LDFLAGS="-L/opt/jemalloc/lib/"
 ---> Using cache
 ---> 0e8d1b1d1def
Step 10/39 : RUN apt update && 	apt -y install build-essential 		bison libyaml-dev libgdbm-dev libreadline-dev 		libncurses5-dev libffi-dev zlib1g-dev libssl-dev && 	cd ~ && 	wget https://cache.ruby-lang.org/pub/ruby/${RUBY_VER%.*}/ruby-$RUBY_VER.tar.gz && 	tar xf ruby-$RUBY_VER.tar.gz && 	cd ruby-$RUBY_VER && 	./configure --prefix=/opt/ruby 	  --with-jemalloc 	  --with-shared 	  --disable-install-doc && 	ln -s /opt/jemalloc/lib/* /usr/lib/ && 	make -j$(nproc) > /dev/null && 	make install
 ---> Using cache
 ---> 6182535d74d2
Step 11/39 : ENV PATH="${PATH}:/opt/ruby/bin:/opt/node/bin"
 ---> Using cache
 ---> 9dcbe0a5a918
Step 12/39 : RUN npm install -g yarn && 	gem install bundler && 	apt update && 	apt -y install git libicu-dev libidn11-dev 	libpq-dev libprotobuf-dev protobuf-compiler
 ---> Running in cc633de0e108
/opt/node/bin/node: 1: /opt/node/bin/node: ELF: not found
/opt/node/bin/node: 2: /opt/node/bin/node: Syntax error: word unexpected (expecting ")")
The command 'bash -c npm install -g yarn && 	gem install bundler && 	apt update && 	apt -y install git libicu-dev libidn11-dev 	libpq-dev libprotobuf-dev protobuf-compiler' returned a non-zero code: 2

Steps to reproduce the problem

Build the docker image like this:

git clone https://github.com/tootsuite/mastodon.git
cd mastodon
git checkout v3.1.0
sudo docker build .

Specifications

v3.1.0

I use a raspberry pi 4 with arch linux on it.

@rinsuki
Copy link
Contributor

rinsuki commented Feb 9, 2020

It looks like we need to consider type of CPU here
https://github.com/tootsuite/mastodon/blob/d2bcef7f6f3e7278e38b3578f631e2bdbb61a573/Dockerfile#L12-L15

This may be helpful:
https://github.com/nodejs/docker-node/blob/46f5203674c748b0701135c8eeea4b250b3ecb6d/13/stretch/Dockerfile#L8-L16

@shleeable
Copy link
Contributor

Yeah, we're not prepared for building on arm... I mean it's likely possible?

@SaraSmiseth
Copy link
Contributor Author

Well I found #802 and saw that #2065 was merged so I thought it was already buildable on arm.

@shleeable
Copy link
Contributor

shleeable commented Feb 9, 2020

@SaraSmiseth I don't really see any reason this shouldn't work cross arch.
I'll look into it later in the week if you haven't been able to get the docker image to compile.

send us any issues you pickup but hopefully you solve it.

@SaraSmiseth
Copy link
Contributor Author

It looks like we need to consider type of CPU here

https://github.com/tootsuite/mastodon/blob/d2bcef7f6f3e7278e38b3578f631e2bdbb61a573/Dockerfile#L12-L15

This may be helpful:
https://github.com/nodejs/docker-node/blob/46f5203674c748b0701135c8eeea4b250b3ecb6d/13/stretch/Dockerfile#L8-L16

Thanks, I got it working. Changing "x64" to "armv7l" in the Dockerfile made it build without errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants