-
Notifications
You must be signed in to change notification settings - Fork 2
Useful Docker Commands and Simple Workflows
Document Docker use cases on the cbio cluster. Given that Docker's target audience is not HPC users, we may be using Docker in somewhat un-traditional ways. At the very least, this may save our users some Googling time.
Maintain a copy of Docker documentation that is actively maintained by the tool creators themselves: https://docs.docker.com/
A container is a sandboxed unix environment. Therefore, the default setting is /not/ to have access to the outside world. To startup a container with access to a particular directory, you /mount/ the directory to a directory in the container:
$ docker run --entrypoint=/bin/bash -it -v /src/mounting/point:/mnt image-id
This basically turns the /mnt
directory into an access point to the directory /src/mounting/point/
Once docker has successfully fired up image-id
, you can cd
into /mnt
and see your directory with all its files. Also, writes to this directory will be persisted after the docker container has been shutdown.
(Some images fire up some program other than bash on startup, for eample b.gcr.io/tensorflow/tensorflow
. To get a bash prompt, you can use the --entrypoint
argument).