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

standard_init_linux.go:207: exec user process caused "exec format error" #62

Closed
ghost opened this issue Mar 28, 2019 · 12 comments
Closed

Comments

@ghost
Copy link

ghost commented Mar 28, 2019

Describe the bug

When I run docker with this container on Raspberry PI I see the following error:

standard_init_linux.go:207: exec user process caused "exec format error"

I think it may be related to that Raspberry PI 3 is ARM based.

Environment (please complete the following information):

  • OS: ubuntu-18.04.2-preinstalled-server-armhf+raspi3.img.xz

Used app version:

  • Docker: bpatrik/pigallery2:1.5.6-stretch
@bpatrik
Copy link
Owner

bpatrik commented Mar 28, 2019

Hi

Yes its the issue with the ARM based architecture.
I tried to quickly create an arm32v7 based docker image (see here), but it was not that straightforward.
It might take some time for me to figure out the solution. In the meantime you can try:

  • Building the Docker file on your own on the raspberry
  • Skipping the docker and running the app from source / release

Update: This might be it. As far as I understand [1, 2], there isn't any straightforward way of building an arm based image on (a x86 based) docker hub.
I'll update the document to reflect this and leave the arm based container there if someone wants to build the image.

@ghost
Copy link
Author

ghost commented Mar 29, 2019

@bpatrik

Thank you for the Dockerfile, however I am getting some issues when building it:

> pigallery2@1.5.9 install /pigallery2
> tsc && gulp build-prod

[00:38:48] Using gulpfile /pigallery2/gulpfile.js
[00:38:48] Starting 'build-prod'...
[00:38:48] Starting 'build-frontend default'...
[00:43:22] 
Missing translation for message "4411a8af7bfef3125efb0326d5e6cf500b5d31f3"
Missing translation for message "b042925fa99951de62f0889093fd2cc59a68e864"
Missing translation for message "291dbda8eb9bfe6de93991c3472307c9af46f48d"
Killed

'build-frontend default' errored after 4.55 min
[00:43:22] Error: Command failed: ng build --aot  --prod --no-extract-licenses --output-path=./dist --no-progress --no-progress --i18n-locale en --i18n-format=xlf --i18n-file=frontend/translate/messages.en.xlf --i18n-missing-translation warning
Missing translation for message "4411a8af7bfef3125efb0326d5e6cf500b5d31f3"
Missing translation for message "b042925fa99951de62f0889093fd2cc59a68e864"
Missing translation for message "291dbda8eb9bfe6de93991c3472307c9af46f48d"
Killed

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:189:13)
    at ChildProcess.EventEmitter.emit (domain.js:459:23)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:189:13)
    at Socket.EventEmitter.emit (domain.js:459:23)
    at Pipe._handle.close (net.js:597:12)
[00:43:22] 'build-prod' errored after 4.55 min
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pigallery2@1.5.9 install: `tsc && gulp build-prod`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the pigallery2@1.5.9 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-03-29T00_43_23_034Z-debug.log
ERROR: Service 'gallery' failed to build: The command '/bin/sh -c git clone https://github.com/bpatrik/pigallery2.git &&     cd /pigallery2 &&     npm install --unsafe-perm &&     npm run build-release &&     cp -r /pigallery2/release /pigallery2-release &&     rm /pigallery2 -R &&     cd /pigallery2-release &&     npm install --unsafe-perm' returned a non-zero code: 1

Unfortunately, I cannot view the contents of /root/.npm/_logs/2019-03-29T00_43_23_034Z-debug.log because it is inside of the container and it is stopped because of the error.

@ghost
Copy link
Author

ghost commented Mar 29, 2019

The whole log output looks like this: https://pastebin.com/qStxB31j

@bpatrik
Copy link
Owner

bpatrik commented Mar 30, 2019

Hi,

That does not look good :/
I'm not sure what the error and I don't have access to a raspberry right now.
So it might take some time while i'm figuring it out.

If you want to stay with docker, you can try using a pre compiled / release version (as it seems the docker build stops at compiling from source)

The docker file would look something like this, but I haven't tested it:

FROM arm32v7/node:10-stretch

RUN  cd ~ && \
wget https://github.com/bpatrik/pigallery2/releases/download/1.5.6/pigallery2.zip && \
unzip pigallery2.zip -d pigallery2 

RUN  cd pigallery2 && \
npm install --unsafe-perm

CMD cd /pigallery2-release && npm start

If it fails with the wget, you can try downloading and unziping the file on the host and copying or mounting (as a volume) to docker.

@Zebradil
Copy link

Zebradil commented Jun 9, 2019

I managed to build working image on aarch64 (Raspberry Pi 3 B+) from this Dockerfile:

FROM node:10-stretch-slim as builder

RUN apt-get update \
 && apt-get install -y python build-essential unzip \
 && rm -rf /var/lib/apt/lists/*

RUN wget https://github.com/bpatrik/pigallery2/releases/download/1.5.6/pigallery2.zip \
 && unzip pigallery2.zip -d pigallery2
RUN cd /pigallery2 \
 && npm install


FROM node:10-stretch-slim

RUN apt-get update \
 && apt-get install -y ffmpeg \
 && rm -rf /var/lib/apt/lists/*

COPY --from=builder /pigallery2 /app

WORKDIR /app

EXPOSE 80

CMD npm start

It should work for any architecture which is supported by node docker image.

@bpatrik
Copy link
Owner

bpatrik commented Jun 10, 2019

Hi @Zebradil,

Thank you very much.
If you happen to have more insight to Docker then me:
I'm actually using very similar Docker file for the app: https://github.com/bpatrik/pigallery2/blob/master/docker/debian/stretch/Dockerfile .
And I'm also building them on docker hub.
As far as I know these images does not run on Raspberry.
How come that your one runs? You are also not using the image arm32v7/node:10-stretch.

Patrik

@Zebradil
Copy link

I started from your Dockerfile FROM arm32v7/node:10-stretch but it didn’t build because of js dependencies aren’t available for my architecture. So, the way out is to build distribution on usual architecture first and the install it inside Dockerfile.

The official node image works because they provide it for different architectures, but somehow implicitly. Docker automatically fetches appropriate version. I don’t know how to implement it with custom image.

@bpatrik
Copy link
Owner

bpatrik commented Jun 10, 2019

I see, thank you very much!

@dan0v
Copy link

dan0v commented Jun 17, 2019

@Zebradil Unfortunately I wasn't able to build using this Dockerfile on Raspberry Pi 3b+

npm ERR! errno 1
npm ERR! sqlite3@4.0.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@4.0.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-06-17T06_09_10_615Z-debug.log
The command '/bin/sh -c cd /pigallery2  && npm install' returned a non-zero code: 1

Edit I am on Stretch 9.9 which doesn't seem to be in the list of supported OS versions, so that's probably why.

@Zebradil
Copy link

Zebradil commented Jun 17, 2019 via email

@bpatrik bpatrik added this to the v1.8 milestone Dec 15, 2019
@bpatrik
Copy link
Owner

bpatrik commented Dec 23, 2019

Pigallery2 now supports arm ( bpatrik/pigallery2:nightly-stretch tested on Raspberry PI 3).
Currently only with nightly build.
Read more at https://github.com/bpatrik/pigallery2/tree/master/docker

@bpatrik bpatrik closed this as completed Dec 23, 2019
@ghost
Copy link
Author

ghost commented Mar 26, 2020

@bpatrik great jobs, works like a charm!

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

No branches or pull requests

3 participants