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

Installing MagicMirror in a Docker container



  • I had a need to run MagicMirror in server mode in a docker container to do some testing. Since I am fairly new to docker I had to do a lot of google searching to get everything working (especially the volumes and networking). I wrote this how-to to guide you through the docker install process, pulling and running the MagicMirror image, and basic configuration. I hope someone finds it useful.

    https://www.putorius.net/2019/01/testing-magic-mirror-running-in-docker.html



  • @savona how do you update mm in docker?



  • Assuming you’re running the container as per instruction on the magicmirror website and have stored the config and modules on the filesystem of your host.

    1. Stop the running container.
    2. Remove the container
    3. Pull the new version from docker hub.
    4. Start the container using the new version.

    So assuming you’ve used the command as instructed on the website:

    docker run -d
    –publish 80:8080
    –restart always
    –volume ~/magic_mirror/config:/opt/magic_mirror/config
    –volume ~/magic_mirror/modules:/opt/magic_mirror/modules
    –name magic_mirror
    bastilimbach/docker-magicmirror

    Updating to the latest version can be done by:

    1. docker stop magic_mirror
    2. docker container rm -v magic_mirror
    3. docker pull bastilimbach/docker-magicmirror
    4. docker run -d
      –publish 8080:8080
      –restart always
      –volume ~/magic_mirror/config:/opt/magic_mirror/config
      –volume ~/magic_mirror/modules:/opt/magic_mirror/modules
      –name magic_mirror
      bastilimbach/docker-magicmirror

    I’ve however noticed, that although the Magic Mirror docker image is just a couple of days old, the Magic Mirror version within the container is over 2500 commits old. So apparently the daily update script is not updating the contents of the docker image on docker hub correctly (missing --no-cache option???). I’ve build a container myself using the associated Dockerfile on github and that results in a up to date version.

    I would recommend making a backup of you’re config and modules folder, just to be on the safe side.

    Using the above method, the old image is still available, so you could easily revert back to the old image, if required. You can remove that image using the ‘docker image rm’ command.

    Kind regards,

    Jorg