Docker Image Support - magic-lantern-studio/mle-documentation GitHub Wiki

This page describes how to build a Docker image for the Magic Lantern host development environment targeting the Ubuntu 22.04 64-bit platform.

Table of Contents

Install Docker

Use the instructions found on the Get Docker CE for Ubuntu web page to install Docker. Use the "Install using the repository" instuctions.

Also, use the instructions on Post-installation steps for Linux to manage docker as a non-root user.

Build Magic Lantern SDK Docker Image

To build a docker image for Magic Lantern SDK, do the following:

$ cd $MLE_HOME/build/docker
$ docker build --rm -t <tag> .

where <tag> is the docker tag for the image. For example, "docker build --rm -t wizzerworks:v0.0.1 ."

To verify that the docker image was built, use:

$ docker image ls -a

You should see the new image listed with the <tag> that was specified in the build command.

Run Magic Lantern SDK Docker Container

To run the docker image built above, do the following:

$ docker run --rm -t -i wizzerworks:v0.0.1 bash

This will run a bash shell in the new Magic Lantern SDK container. When you exit the bash shell, the container will stop and be removed from the list of available containers.

Run Magic Lantern null Title

The Magic Lantern null title may be executed from the Docker container.

First run the following command to allow X11 forwarding for your user:

$ xhost +local:

This is not persistent, so it must be run on the Host machine if the device is rebooted.

In order to execute the null title from within the docker container, the X11 DISPLAY variable must be set and the X11 UNIX socket must be available via a docker volume.

$ docker run --rm -t -i -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix:/tmp/.X11-unix wizzerworks:v0.0.1 bash
$ root@da5629e37fd2: cd $MLE_HOME/Titles/null/rehearsal
$ root@da5629e37fd2: player workprints/null.dwp

Run Magic Lantern mtea Title

The Magic Lantern Moving Teapot (mtea) can be executed from the Docker container.

First run the following command to allow X11 forwarding for your user:

$ xhost +local:

This is not persistent, so it must be run on the Host machine if the host is rebooted.

In order to execute the mtea title from within the docker container, the X11 DISPLAY variable must be set and the X11 UNIX socket must be available via a docker volume.

$ docker run --rm -t -i -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix:/tmp/.X11-unix wizzerworks:v0.0.1 bash
$ root@da5629e37fd2: cd $MLE_HOME/Titles/mtea/src
$ root@da5629e37fd2: player mtea.dwp

Docker Tips

The following tips are useful when working with Docker images and containers.

List all exited containers

$ docker ps -aq -f status=exited

Remove stopped containers

$ docker ps -aq --no-trunc -f status=exited | xargs docker rm

This command will not remove running containers, only an error message will be printed out for each of them.

Remove dangling/untagged images

$ docker images -q --filter dangling=true | xargs docker rmi

Remove containers created after a specific container

$ docker ps --since a1bz3768ez7g -q | xargs docker rm

Remove containers created before a specific container

$ docker ps --before a1bz3768ez7g -q | xargs docker rm

Use --rm for docker build

Use --rm together with docker build to remove intermediary images during the build process.

⚠️ **GitHub.com Fallback** ⚠️