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

Running from raspberry pi with docker image getting error #69

Closed
ardinusawan opened this issue Jun 10, 2020 · 7 comments
Closed

Running from raspberry pi with docker image getting error #69

ardinusawan opened this issue Jun 10, 2020 · 7 comments

Comments

@ardinusawan
Copy link
Contributor

Describe the bug
I think docker image for raspberry pi builded from wrong image

To Reproduce
Steps to reproduce the behavior:

osmc@osmc:~$ sudo docker run -d --restart=always -p 8000:8000 --name=green-tunnel sadeghhayeri/green-tunnel:arm
ca2387d24d497b442ff5b7fa5415d19e0c21106ef1b788c7689588989e96e5df
osmc@osmc:~$ sudo docker ps
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS                         PORTS               NAMES
ca2387d24d49        sadeghhayeri/green-tunnel:arm   "/bin/sh -c 'node ./…"   24 seconds ago      Restarting (1) 4 seconds ago                       green-tunnel
osmc@osmc:~$ sudo docker logs -f --tail 10 green-tunnel
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"

Expected behavior
Container running without error

Additional context

  • OS: macOS Cataline v10.15.5
  • Docker: 19.03.11, build 42e35e6

My PR already merged on this but I think you forgot to uncomment it when build docker image with arm tag. Please update the image 🙏

@SadeghHayeri
Copy link
Owner

Oh sorry :/
yes, I forgot to uncomment the line!

but now I get error while building the image:

Sending build context to Docker daemon  6.342MB
Step 1/13 : FROM balenalib/raspberry-pi-alpine-node
 ---> edb788ad0fb6
Step 2/13 : ENV PORT 8000
 ---> Using cache
 ---> 6221b56a6b6e
Step 3/13 : ENV VERBOSE 'green-tunnel:*'
 ---> Using cache
 ---> 95aa05c1b36e
Step 4/13 : ENV SILENT false
 ---> Using cache
 ---> 5274950882f7
Step 5/13 : ENV DNS_TYPE 'https'
 ---> Using cache
 ---> a4db38d6d5ac
Step 6/13 : ENV DNS_SERVER 'https://cloudflare-dns.com/dns-query'
 ---> Using cache
 ---> 2d9723c68068
Step 7/13 : WORKDIR /green-tunnel
 ---> Using cache
 ---> 889c0d4a763a
Step 8/13 : COPY package*.json ./
 ---> Using cache
 ---> 11e004822139
Step 9/13 : RUN npm ci
 ---> Running in 20923ed901e5
standard_init_linux.go:211: exec user process caused "exec format error"
The command '/bin/sh -c npm ci' returned a non-zero code: 1
‍‍‍```
Is it ok for you? should I build the image in raspi?

@ardinusawan
Copy link
Contributor Author

Hmm I try on my pc and it works

Diff:

diff --git a/Dockerfile b/Dockerfile
index 61a0d4e..2b08406 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
-FROM mhart/alpine-node:12
+# FROM mhart/alpine-node:12
 # Use this instead to build image for Raspberry Pi
-# FROM balenalib/raspberry-pi-alpine-node
+FROM balenalib/raspberry-pi-alpine-node
 
 ENV PORT 8000
 ENV VERBOSE 'green-tunnel:*'

Build image:

➜  GreenTunnel git:(master) ✗ docker build -t green-tunnel --file Dockerfile .
Sending build context to Docker daemon  6.252MB
Step 1/13 : FROM balenalib/raspberry-pi-alpine-node
 ---> edb788ad0fb6
Step 2/13 : ENV PORT 8000
 ---> Using cache
 ---> c5c85d83255d
Step 3/13 : ENV VERBOSE 'green-tunnel:*'
 ---> Using cache
 ---> 2d718ca37434
Step 4/13 : ENV SILENT false
 ---> Using cache
 ---> 4af34d5e19d0
Step 5/13 : ENV DNS_TYPE 'https'
 ---> Using cache
 ---> a9823583e0d7
Step 6/13 : ENV DNS_SERVER 'https://cloudflare-dns.com/dns-query'
 ---> Using cache
 ---> d83ab441fa7b
Step 7/13 : WORKDIR /green-tunnel
 ---> Using cache
 ---> 4cd76191e464
Step 8/13 : COPY package*.json ./
 ---> Using cache
 ---> edc716b90658
Step 9/13 : RUN npm ci
 ---> Using cache
 ---> 33410717a282
Step 10/13 : COPY src ./src
 ---> Using cache
 ---> 07db647e2e49
Step 11/13 : COPY bin ./bin
 ---> Using cache
 ---> 8be83ee7201f
Step 12/13 : EXPOSE 8000/tcp
 ---> Using cache
 ---> cc4a4b57e16d
Step 13/13 : CMD node ./bin/gt.js       --verbose $VERBOSE      --ip 0.0.0.0    --port $PORT    --silent $SILENT        --system-proxy false    --dns-type $DNS_TYPE    --dns-server $DNS_SERVER
 ---> Using cache
 ---> deeab5a20583
Successfully built deeab5a20583
Successfully tagged green-tunnel:latest

@ardinusawan
Copy link
Contributor Author

Or maybe you create org account on docker hub and let me push the raspi image? @SadeghHayeri

@SadeghHayeri
Copy link
Owner

Ok, give me your docker hub username.

@ardinusawan
Copy link
Contributor Author

ardinusawan13

@SadeghHayeri
Copy link
Owner

Thanks but using buildx I successfully build the image for the arm and fix github-actions too.
can you check it again?

@ardinusawan
Copy link
Contributor Author

Tested and it works! Thx mate 👍

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

2 participants