• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Docker setup is not working

Scheduled Pinned Locked Moved Troubleshooting
7 Posts 4 Posters 5.0k Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    z0diak
    last edited by Apr 16, 2017, 4:23 PM

    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:

    • “NetworkError: 404 Not Found - http://192.168.99.100/vendor/node_modules/moment/min/moment-with-locales.js”
    • “NetworkError: 404 Not Found - http://192.168.99.100/vendor/node_modules/moment-timezone/builds/moment-timezone-with-data.js”
    • “NetworkError: 404 Not Found - http://192.168.99.100/vendor/node_modules/font-awesome/css/font-awesome.min.css”
    • “NetworkError: 404 Not Found - http://192.168.99.100/vendor/node_modules/weathericons/css/weather-icons.css”
    • clock.js (line 49, column 3) ReferenceError: moment is not defined
    • clock.js (line 77, column 7) ReferenceError: moment is not defined

    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 https://github.com/MichMich/MagicMirror/pull/846 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

    S 1 Reply Last reply Apr 20, 2017, 11:57 AM Reply Quote 0
    • K Offline
      karsten13
      last edited by Apr 18, 2017, 9:49 PM

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

      1 Reply Last reply Reply Quote 0
      • S Offline
        strawberry 3.141 Project Sponsor Module Developer @z0diak
        last edited by Apr 20, 2017, 11:57 AM

        @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.

        Please create a github issue if you need help, so I can keep track

        1 Reply Last reply Reply Quote 0
        • Z Offline
          z0diak
          last edited by Apr 20, 2017, 12:51 PM

          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/postinstall.sh /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

          1 Reply Last reply Reply Quote 0
          • Z Offline
            z0diak
            last edited by z0diak Apr 20, 2017, 1:30 PM Apr 20, 2017, 1:30 PM

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

            1 Reply Last reply Reply Quote 0
            • K Offline
              karsten13
              last edited by Apr 20, 2017, 5:31 PM

              The docker setup is outsourced to https://github.com/bastilimbach/docker-MagicMirror and I already posted an issue for the black screen problem there: https://github.com/bastilimbach/docker-MagicMirror/issues/2

              1 Reply Last reply Reply Quote 0
              • B Offline
                bastilimbach
                last edited by Apr 20, 2017, 9:20 PM

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

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  5/7
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy