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

Add the ability to use the docker image with a raspberry pi #846

Merged
merged 3 commits into from
Apr 12, 2017
Merged

Add the ability to use the docker image with a raspberry pi #846

merged 3 commits into from
Apr 12, 2017

Conversation

bastilimbach
Copy link
Contributor

What does this PR do?

This PR replaces the base image from the Dockerfile and fixes some little thinks (see related issues).
Due to the raspberry pi architecture, the current Docker image doesn't work with any Raspberry PI, because it uses Debian with an x86 architecture. I replaced Debian with an ARM compatible Linux distro, so the image also works on a Raspberry PI.

Related issues

#835 #833

Important

@MichMich You need to connect this repo to your Docker Hub/Store account, so we can actually use this command. This will also fix #835.

Sebastian Limbach added 3 commits April 12, 2017 20:19
I changed the linux distribution from node, which used Debian, to an arm based linux distribution so the application can be used on an arm based system (e.g. Raspberry)
@bastilimbach bastilimbach mentioned this pull request Apr 12, 2017
@MichMich MichMich merged commit f45bd18 into MagicMirrorOrg:develop Apr 12, 2017
@MichMich
Copy link
Collaborator

I'm don't have any experience with docker. The docker support is all contributed by the community. If you give me a small run through what I need to do and need to fill in, I'll look at it. Feel free to send me a mail about it if that's more suited: michael [at] xonaymedia.nl

@bastilimbach
Copy link
Contributor Author

bastilimbach commented Apr 12, 2017

I would love to. It's fairly straight forward:
(You can just click on my provided links)

  1. Create an account at Docker Hub.
  2. Log In and go into your linked accounts settings.
  3. Link to Github by choosing "Limited Access" (only public GitHub repos) or "Public and Private".
  4. Create an automated build.
  5. Choose the Magic Mirror Repo from the list
  6. Set the visibility to "public" and hit create.

That's it 👍

Now everytime someone commits to the master branch, docker hub will generate a new image automatically. After these 6. Steps you don't need to do anything else in the future. Docker Hub handles everything for you.

If you need further assistance, I'm happy to help. Either here or at bastilimbach[at]gmail.com

@@ -59,7 +59,7 @@ docker run -d \
--volume ~/magic_mirror/config:/opt/magic_mirror/config \
--volume ~/magic_mirror/modules:/opt/magic_mirror/modules \
--name magic_mirror \
MichMich/MagicMirror
michmich/magicmirror
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MichMich Also if you successfully created the automated build, we need to check, if the naming is still correct. (docker_id/repo_name)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. I've tried to build a docker image based on this Dockerfile and it fails:

Sending build context to Docker daemon 7.095 MB
Step 1/12 : FROM izone/arm:node
node: Pulling from izone/arm
c5223e92d61a: Pull complete
1360befcec1b: Pull complete
Digest: sha256:2d7ef24f6bdf6c7e462587c2054755f383f8f35ea73bf3aba74f68859b7610b2
Status: Downloaded newer image for izone/arm:node
 ---> 4a6b73a00ecb
Step 2/12 : ENV NODE_ENV production
 ---> Running in f729f4b4891d
 ---> f2f5459d46a2
Removing intermediate container f729f4b4891d
Step 3/12 : ENV MM_PORT 8080
 ---> Running in 394f3d8d009f
 ---> 94571211dd56
Removing intermediate container 394f3d8d009f
Step 4/12 : WORKDIR /opt/magic_mirror
 ---> 54fba0cc5e8c
Removing intermediate container 50ff50c69f23
Step 5/12 : COPY package.json /opt/magic_mirror
 ---> 87954b5aa71b
Removing intermediate container 64a25a5d5b66
Step 6/12 : RUN npm install
 ---> Running in 009897841bcf
standard_init_linux.go:178: exec user process caused "exec format error"
The command '/bin/sh -c npm install' returned a non-zero code: 1

My setup is: Windows 7 64bit, docker Server Version: 17.04.0-ce

While current master's Dockerfile ( 25b5daf ) builds fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mh, looks like an error caused by windows because it works on macOS. It could be possible, that dos2unix isn't converting the file correctly. But I never worked with dos2unix before. I just copied this part from PR #743

Copy link
Contributor Author

@bastilimbach bastilimbach Apr 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@z0diak could you check if the dockerfile from this commit (#825) works? I don't have a windows machine to test this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bastilimbach , yes, it builds successfully. I think dos2unix has nothing to do with it since it fails on RUN npm install command, before first dos2unix call. I've googled this errors message and it shows A LOT issues like this for different containers that uses ARM. Some issues for Mac (moby/moby#23865), some for linux and windows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That unfortunate. I think it fails on some mac and windows machines because the arm image doesn't work with the kernel of the "root" os.
We could get around this issue by providing a "recommended server os" section or two dockfile versions. One which uses an arm base image and one which uses normal ubuntu or some sort of x86 os. @MichMich what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also use the docker tag feature. So michmich/magicmirror:latest uses an ubuntu image whereas michmich/magicmirror:arm uses an arm type os.

@bastilimbach bastilimbach mentioned this pull request Apr 16, 2017
1 task
@MichMich
Copy link
Collaborator

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

Successfully merging this pull request may close these issues.

3 participants