open-learning-exchange / planet

🌍 Planet Learning - Angular application
https://hub.docker.com/r/treehouses/planet
GNU Affero General Public License v3.0
62 stars 39 forks source link

planet-test failed on raspberry pi #853

Closed xyb994 closed 6 years ago

xyb994 commented 6 years ago

tried

services:
  couchdb:
    expose:
      - 5984
    image: treehouses/rpi-couchdb:2.1.1
    ports:
      - "2200:5984"
      - "2201:5986"
  db-init:
    image: treehouses/planet-test:db-init
    depends_on:
      - couchdb
    environment:
      - COUCHDB_HOST=http://couchdb:5984
  planet:
    image: treehouses/planet-test:latest
    ports:
      - "80:80"
    environment:
      - MULTIPLE_IPS=true
      - HOST_PROTOCOL=http
      - DB_HOST=127.0.0.1
      - DB_PORT=2200
      - CENTER_ADDRESS=earth.ole.org:2200
    depends_on:
      - couchdb
version: "2"

got following error

root@raspberrypi:~# docker-compose -f planet-test.yml -p planet-test logs -f
Attaching to planettest_planet_1, planettest_db-init_1, planettest_couchdb_1
planet_1   | standard_init_linux.go:190: exec user process caused "exec format error"
db-init_1  | standard_init_linux.go:190: exec user process caused "exec format error"
planettest_planet_1 exited with code 1
planettest_db-init_1 exited with code 1
xyb994 commented 6 years ago

btw, worked fine on x86

sahilph commented 6 years ago

On line 5. You used treehouses/rpi-couchdb:2.1.1 . treehouses/rpi-couchdb:2.1.1 is only for raspberry pi. Use treehouses/couchdb:2.1.1 instead. Its Multi-arch.

sahilph commented 6 years ago

also @dogi has made some changes. For the time being use treehouses/planet-multi instead of treehouses/planet-test for testing until everything is smoothly migrated to treehouses/planet Here is the modified file.

How to test:

  1. You will have to create a planet-test.yml file with the following contents:
services:
  couchdb:
    expose:
      - 5984
    image: treehouses/couchdb:2.1.1
    ports:
      - "2200:5984"
      - "2201:5986"
  db-init:
    image: treehouses/planet-multi:db-init
    depends_on:
      - couchdb
    environment:
      - COUCHDB_HOST=http://couchdb:5984
  planet:
    image: treehouses/planet-multi:latest
    ports:
      - "80:80"
    environment:
      - MULTIPLE_IPS=true
      - HOST_PROTOCOL=http
      - DB_HOST=127.0.0.1
      - DB_PORT=2200
      - CENTER_ADDRESS=earth.np.ole.org:5986
    depends_on:
      - couchdb
version: "2"
  1. Then use the following command to spawn your environment for the first time.
docker-compose -f planet-test.yml -p planet-test up -d --build

See if the docker containers running

docker ps

You'll see you containers like this

CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS                                                                NAMES
ea3b914c3193        planetdev_planet    "/bin/sh -c 'bash ..."   About a minute ago   Up 58 seconds       0.0.0.0:3000->3000/tcp                                               planetdev_planet_1
57f30698ccda        klaemo/couchdb      "tini -- /docker-e..."   About a minute ago   Up About a minute   4369/tcp, 9100/tcp, 0.0.0.0:2200->5984/tcp, 0.0.0.0:2201->5986/tcp   planetdev_couchdb_1

Connect to your planetdev_planet with

docker logs {{id}}

in this case

docker logs ea3b914c3193 -f

press CTRL+C to exit logs view

  1. When you're done, you can do the following command
docker-compose -f planet-test.yml -p planet-test stop
xyb994 commented 6 years ago

@sahilph

Yes, the problem did occur on Raspberry Pi. First thing I tried was using treehouses/couchdb:2.1.1, then we tried treehouses/rpi-couchdb:2.1.1. Since they are essentially pulling the same image to the Pi, both were giving the same error mentioned above.

Thanks for the reminder, sorry that I did not read the original PR commits detail. I will use treehouses/planet-multi in the future.

dogi commented 6 years ago

My error I think I did tell you the wrong one and did not see the error ... Sorry @xyb994 and thanks @sahilph

sahilph commented 6 years ago

No Problem @xyb994 @dogi. Happy to help. :smile: