MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

Docker setup is not working

  • Hi all,

    Here is my use-case: I want to create a module for MM and I want to have MM running in sever mode as a docker on my PC to create-n-debug module locally first and then deploy it to Raspberry.

    Ok, current docker instructions from github doesn’t work, but np, Dockerfile is ok. So I pulled “master”, fixed config (just whitelisted all IPs) and created docker image locally based on it (docker image build < path to local repo >). Then I create container from it, go to web-server’s address and see empty black screen. Starting to debug and see that few HTTP requests end with 404. Here they are:

    Ok, what I did is logged into container and ls-ed to /vendor dir and realize there are really no such files. I’ve searched through gitlab repo and realized there are no such files too.

    I’ve looked through issues and realize that pull request is not going to fix issue that I’m experiencing. Moreover dockerfile from this PR is not building on my PC.

    I’m not an expert in NodeJs but I assume list of possible problems are following:

    1. I’m missing something 🙂
    2. Docker installation scripts doesn’t contain some instructions that exists in Raspberry installation scripts and nobody really using docker so I’m the first to see this issue
    3. Those files are somehow dynamic and appear at runtime (or some mod_rewrite works), but I don’t see why they are not work and see no rules for those files to proceed dynamically (search through code by “moment” doesn’t show anything that rings the bell for me).

    My setup:
    Windows 7 64-bit
    Dockertools Server Version: 17.04.0-ce

    Appreciate any hints how this can be solved.
    Ready to contribute a fix (to code or documentation) if it will be needed

  • replacing “npm install” with “npm install --unsafe-perm” solved my blackscreen problem.

  • Project Sponsor Module Developer

    @z0diak those files have to be installed with npm install in the vendor directory or run npm install in MagicMirror directory which automatically installs the vendor as well.

  • Initiated container, ran “npm install” and here are results:

    # npm install
    npm info it worked if it ends with ok
    npm info using npm@4.2.0
    npm info using node@v7.9.0
    npm info lifecycle magicmirror@2.1.1~preinstall: magicmirror@2.1.1
    npm info linkStuff magicmirror@2.1.1
    npm info lifecycle magicmirror@2.1.1~install: magicmirror@2.1.1
    npm WARN lifecycle magicmirror@2.1.1~install: cannot run in wd %s %s (wd=%s) mag
    icmirror@2.1.1 cd vendor && npm install /opt/magic_mirror
    npm info lifecycle magicmirror@2.1.1~postinstall: magicmirror@2.1.1
    npm WARN lifecycle magicmirror@2.1.1~postinstall: cannot run in wd %s %s (wd=%s)
     magicmirror@2.1.1 sh installers/postinstall/ /opt/magic_mirror
    npm info ok
    # ls vendor
    package.json  vendor.js

    Unless I use --unsage-perm it just doesn’t work. Thanks to you and @karsten13

  • @MichMich should this be submitted as an issue to GitHub?

  • The docker setup is outsourced to and I already posted an issue for the black screen problem there:

  • I added the --unsafe-perm to the npm install process in the Dockerfile. (3a5dbc4) This should fix the issues 👍

Log in to reply