-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
FROM node:latest | ||
FROM izone/arm:node | ||
|
||
# Set env variables | ||
ENV NODE_ENV production | ||
ENV MM_PORT 8080 | ||
|
||
WORKDIR /opt/magic_mirror | ||
|
||
COPY . . | ||
COPY /modules unmount_modules | ||
COPY /config unmount_config | ||
# Cache node_modules | ||
COPY package.json /opt/magic_mirror | ||
RUN npm install | ||
|
||
# Copy all needed files | ||
COPY . /opt/magic_mirror | ||
|
||
# Save/Cache config and modules folder for docker-entrypoint | ||
COPY /modules /opt/magic_mirror/unmount_modules | ||
COPY /config /opt/magic_mirror/unmount_config | ||
|
||
RUN apt-get update \ | ||
&& apt-get -qy install tofrodos dos2unix \ | ||
&& chmod -R 777 vendor \ | ||
&& npm install \ | ||
&& cd vendor \ | ||
&& npm install \ | ||
&& cd .. \ | ||
&& dos2unix docker-entrypoint.sh \ | ||
&& chmod +x docker-entrypoint.sh | ||
# Convert docker-entrypoint.sh to unix format and grant execution privileges | ||
RUN apk update \ | ||
&& apk add dos2unix --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \ | ||
&& dos2unix docker-entrypoint.sh \ | ||
&& chmod +x docker-entrypoint.sh | ||
|
||
EXPOSE $MM_PORT | ||
ENTRYPOINT ["/opt/magic_mirror/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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:
My setup is: Windows 7 64bit, docker Server Version: 17.04.0-ce
While current master's Dockerfile ( 25b5daf ) builds fine
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.