Docker Container
To use the containerized version of Myna and it's open-source dependencies, you can use the Myna Docker container hosted at https://github.com/ORNL-MDF/containers.
- Install Docker Desktop under an appropriate license.
- Open Docker Desktop.
- Pull the Myna Docker image. In the bottom right of the Docker Desktop window, click
"Terminal" (if prompted, hit "enable") and enter
docker pull ghcr.io/ornl-mdf/containers/ubuntu:dev. Once completed, the image will show up in the "Images" tab of Docker. - (Optional) Link your data directory or server to a Docker volume that can be used across multiple Docker instances. Use the docker volume create command, following the documentation for your specific data configuration.
- (Optional) If you use Visual Studio Code for your development environment, then
you can install the
DockerandDev Containersextensions to work with Docker containers from within Visual Studio Code. - Launch an interactive Docker container to execute code within the Docker environment:
- From a command terminal:
docker run -it ghcr.io/ornl-mdf/containers/ubuntu:dev - From Visual Studio Code: Click on the Docker tab on left-hand navigation bar.
Select the
ghcr.io/ornl-mdf/containers/ubuntu:devcontainer, right-click and selectRun interactive. A new entry will appear in the "container" section. Right-click the container and selectAttach Visual Studio Code. For more detailed instructions and troubleshooting, see the Docker extension documentation. - Within the Docker container, the Myna examples are located at
/opt/myna/examples/. Runnable cases are under/opt/myna/examples/cases/, sample databases are under/opt/myna/examples/databases/, workspace files are under/opt/myna/examples/workspaces/, and standalone scripts are under/opt/myna/examples/utils/. These can be copied to your current working directory withcp -r /opt/myna/examples ./myna_examples. To run examples, follow the instructions at Getting Started: Using Myna.
When an application stage uses docker-image, Myna runs the container as the UID of
the user who launched myna. This keeps files written to bind-mounted directories
owned by the host user. To use a different container user, specify Docker's user
run option in that stage's YAML or JSON docker-config file, for example
user: "1000:1000".
Myna sends each application command through the image's configured entrypoint. This
allows an image entrypoint to activate its runtime environment before it runs the
command. To replace that entrypoint for a stage, set Docker's entrypoint option in
the stage's YAML or JSON docker-config file, for example:
entrypoint: /opt/app/custom-entrypoint.sh