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

Raspberry: How to run it on a Pi #116

Open
3 tasks
narfel opened this issue Jan 14, 2019 · 12 comments
Open
3 tasks

Raspberry: How to run it on a Pi #116

narfel opened this issue Jan 14, 2019 · 12 comments

Comments

@narfel
Copy link

narfel commented Jan 14, 2019

What is the purpose of your issue?

  • Bug report (encountered problems with amazon-dash)
  • Feature request (request for a new functionality)
  • Question
  • [x ] Other

Well neither of my two things are a bug, but maybe it helps someone trying to get a docker container running. The docker image in the wiki is not for arm devices and is not marked as such. The error message "exec format error"" may also be a bit unspecific, although the whole thing just works on e.g. a raspberry. You have to build the image from the docker file (on the Pi) and then run it as instructed with something like: "docker run -it --network=host --name amazon-dash -v local_docker_datadir:/config nekmo/amazon-dash:latest amazon-dash run --ignore-perms --root-allowed --config /config/amazon-dash.yml" This example line has an additional --name flag to start/stop the container easier and i had to omit the amazon-dash.yml when running the docker image otherwise it would (again misleadingly) complain about not being able to connect to /config/amazon-dash.yml because it is a directory. Hint: It's not :)

@Nekmo
Copy link
Owner

Nekmo commented Jan 15, 2019

I am not an expert in Docker, but as I know architecture should not be a problem. The program to be executed is native Python code and there are no dependencies not compatible with ARM.

Can you please paste the complete error messages? Thanks!

@narfel
Copy link
Author

narfel commented Jan 15, 2019

Neither am I sadly. But the problem is not with python, python tools or any of your code. Just that the container is not a multiarch or armhf. The base image architecture that was used to build the image is not armhf and will not run on a pi/arm device. If you build it yourself you will build a container for whatever architecture you are on. It sounds complicated and against dockers stipulation, but there is no way docker magically makes a architecture leap. That's at least as i understand it. The exact error message is "standard_init_linux.go:#: exec user process caused "exec format error"" with the number being whatever line the script fails. But it is misleading, there is no script error. It's just the first thing that breaks.

@Nekmo
Copy link
Owner

Nekmo commented Jan 15, 2019

I have no chance to try, but you can change the image used in the Dockerfile. Replace "FROM python:3.7-alpine" with "FROM arm32v7/python:3.7.2-alpine3.7"

https://hub.docker.com/r/arm32v7/python/

If this works for you I can document it. Thanks!

@narfel
Copy link
Author

narfel commented Jan 16, 2019

I'm not sure if we're misunderstanding each other. I'm just talking about the image you get when you do a pull with docker pull nekmo/amazon-dash:latest That doesn't work on arm. If you build the image yourself from the docker file with docker image build <image name> you get all platform dependencies automatically resolved and it works. The Docker build process automatically takes the arm versions needed. There is no need to change the docker file as is.

tl;dr: If you want to use nekmo/amazon-dash on an arm device, you can't just run docker pull nekmo/amazon-dash, but instead have to run docker build -t nekmo/amazon-dash:latest .

@Nekmo
Copy link
Owner

Nekmo commented Jan 19, 2019

I'm going to investigate how the Docker image can be uploaded using ARM. I do not have much experience about Docker Hub, thanks.

@airdrummingfool
Copy link

Thanks @narfel , I had no idea you could just build a Docker image directly on your device to avoid an architecture mismatch - that is a game-changer!

@Nekmo It might be helpful to add a note to the Readme about this. Since you can't run the image as-is from the Docker Hub, you have to build it locally and then use that custom-built image.

Here's what I did:

  1. Build the image (I called mine amazon-dash-rpi)
    sudo docker image build --tag amazon-dash-rpi --file Dockerfile https://github.com/Nekmo/amazon-dash.git
    
  2. Use "amazon-dash-rpi" in place of "nekmo/amazon-dash:latest" in the docker run command (or the docker-compose.yml file)

@Nekmo
Copy link
Owner

Nekmo commented Feb 3, 2019

I will try to update the Docker hub image for Raspberry Pi users 👍

@zachsteffens
Copy link

@airdrummingfool

sudo docker image build --tag amazon-dash-rpi --file Dockerfile https://github.com/Nekmo/amazon-dash.git

didn't work for me. had some unsatisfiable constraints.

  libpcap-1.9.0-r1:
    breaks: world[libpcap=1.8.1-r1]
    satisfies: tcpdump-4.9.2-r4[so:libpcap.so.1]
  scapy-2.4.2-r0:
    breaks: world[scapy=2.4.0-r0]
  tcpdump-4.9.2-r4:
    breaks: world[tcpdump=4.9.2-r3]```

@xtools-at
Copy link

xtools-at commented Mar 12, 2019

I've had some troubles on a RPi too and was able to fix the broken scapy-install by getting it from apt: sudo apt-get install python-scapy (using Python 3.5)
maybe this will do it for you: sudo apt-get install libcap-dev tcpdump python-scapy

@shoejosh
Copy link

For anyone else needing this for pi, I went ahead and pushed an image built on my pi until an an official ARM image is available from @Nekmo .

shoejosh/amazon-dash-rpi

The only change I made was to update a few dependencies to match the versions I already had installed on my pi so the image would build.

@madbear2000
Copy link

Thanks @xtools-at I was having the same problem but your suggest install fixed the issue.
@shoejosh Thanks also for the docker image it will be very useful

@MaObOriginal
Copy link

Any updates on this? Does an official arm image exist?

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

8 participants