This article shows how to build and start a container using the Docker files provided with Lumerical installation package and run a simulation in the container.
Prerequisites
You need to have Docker for Windows installed, with the WSL2 backend.
Docker files are provided with the Lumerical Linux installation package (2023 R1 or later) and located in the “docker” folder.
They will install Lumerical tools on a standard Linux OS, using Ubuntu image or Amazon Linux image, with the selected MPI variant (MPICH2, Intel MPI or Open MPI).
Build a container
You can follow the following steps to build a container and install Lumerical with MPICH2 on Ubuntu, using the file “Dockerfile-ubuntu-mpich2nem”.
- Open a Command Prompt window and navigate to the folder where the Dockerfile is located
- Call 'docker build', providing a tag, port, license server, name of the Dockerfile, and the top level of the installation package as context
docker build --rm -t local/{image_name} --build-arg "license_server={port@license_server_url}" -f {Dockerfile_name} ../../
Note: It might take some time to create your first image as you have to download and install the base OS and required components. A “lumerical” user account is also created.
Once created, the image will be listed in Docker Desktop.
Start a container and run a simulation
To start a container, use “docker run”:
docker run -ti --rm local/{image name} /bin/bash
This will start a bash shell in the current Prompt window.
You can also start the container with a local folder mounted in the home directory of the container, for example, to access your simulation files:
docker run -ti --rm -v {local folder path}:/home/lumerical local/{image name} /bin/bash
Once the container has started, you can run a simulation using the installed MPI variant:
Refer to the “README” file in the “docker” folder for additional information on starting a container with other MPI variants.