You can either pull the Docker image from Docker Hub or build it yourself.
To pull the image from Docker Hub, follow these steps:
- Open your terminal.
- Run the following command:
docker pull bsplu/rest_docker
- Verify the image has been pulled by running:
docker images
To build the Docker image yourself, follow these steps:
- Open your terminal.
- Navigate to the directory containing the Dockerfile.
- Run the following command:
docker build -t [name]:[version] .
- Verify the images after a successful build:
docker images
- [Optional] After you build, you may want to clean the cache:
docker image prune -f
Note:
[name]
is the image name you want to use, likerest/mpi
,your_name/rest/x86
, etc.[version]
is the version tag for the named image, likev0.2
, etc.- If you are in China, you may want to use
docker build --build-arg CHINA=True -t [name]:[version] .
to speed up downloading files.
To run the container in interactive mode:
- Open your terminal.
- Run the following command:
docker run --rm -it [name]:[version] /bin/bash
- When done, type
exit
to leave the container.
To run the container for job submission:
- Open your terminal.
- Run the following command:
docker run --rm -v /path/to/local/dir:/path/in/container -w /path/in/container [name]:[version] /bin/bash -c "rest"
Run the following command:
singularity build [name]_[version].sif docker-daemon://[name]:[version]
- Export the Docker image:
docker save -o [name]_[version].tar [name]:[version]
- Build the Singularity image:
singularity build [name]_[version].sif docker-archive://[name]_[version].tar
To run the Singularity container:
singularity exec --bind /path/to/local:/path/in/container [name]_[version].sif bash -c "rest"
- If you want to debug code in the image, you can run:
docker run --rm -it [name]:[version] sudo su - && /bin/bash
- If you want to write a Dockerfile based on this repository, you can use:
FROM bsplu/rest_docker USER root