Usage

Note

You don’t need the repository content to use the Docker Hub images.

Launch with an interactive shell

To launch the container with an interactive shell on a host with Docker Desktop running, just type:

$ docker run -it --platform linux/amd64 -v ~/Workspace:/root/WorkDir rxastro/casa6:latest bash

This will download the image rxastro/casa6:latest, start a container instance, and login as root (bravely…). It will also try to mount the host directory ~/Workspace (assuming it exists) to /root/WorkDir of your container. After this, you can perform code development and data analysis in /root/WorkDir of your container (now pointing to ~/Workspace on the host), with access of tools/environment (e.g. casa6, astropy, etc.) residing in the image.

In case you would like to manually update local-cached images for whatever reasons, you probably want to run this before launching the container again:

$ docker pull rxastro/casa6:latest

Use with Jupyter

A Jupyter server has been built in the Docker image rxastro/casa6:latest (see the Dockerfile content for its customization). This creates a useful feature of rx.astro/casa6:latest: you can connect your host web browser to the Jupyter server running its container instance. This gives you a portable development environment semi-isolated from your host OS that offers all Jupyter-based features (e.g. Widgets) along with many Python packages: casatools, casatasks, astropy, numpy, matplotlib, and more.

To log in a rxastro/casa6:latest container and start the Jupyter session,

user@host      $ docker run --platform linux/amd64 -v ~/Workspace:/root/WorkDir --env PORT=8890 -it -p 8890:8890 rxastro/casa6:latest bash
root@container $ jupyter-lab # start a Jupyter session

Then you can move back to the host, open a web browser, and connect it to the Jupyter server running on the guest OS:

user@host      $ firefox --new-window ${address:8890-with-token}

work-in-progress: If you download the example data and notebooks and put them in ~/Workspace on the host, you should be able to re-run them in your firefox window as shown in the example pages: ism3d.uvhelper, ism3d.arts, and ism3d.arts.lens

Use with Apptainer (formally, Singularity)

Docker and OCI containers are supported by Apptainer for HPC-based deployment:

$ apptainer pull docker://rxastro/casa6:latest
$ file casa6_latest.sif
$ apptainer inspect casa6_latest.sif
$ apptainer exec casa6_latest.sif /bin/bash

Note

  • There are significant design differences between Docker and Apptainer, and a detailed demonstration is beyond the scope of this documentation.

  • Apptainer offers various options to bind paths/mounts.

As a Docker base image

You can start from the Dockerfile of rxastro/casa6:latest, edit it (e.g., add more packages or your pipeline/workflow), and build a local image to your specification (see the local build instruction).

You can also directly use the online Docker Hub image as the base image for your custom build, which may save some time. Just put FROM: rxastro/casa6:latest in your Dockerfile.