Core Docker commands

This section contains core Docker commands for running containers and pushing images to the BioData Catalyst powered by Seven Bridges image registry.

Make sure Docker is running

  • Mac OS 10.10.3 Yosemite or newer: run Docker Desktop for Mac and start a terminal of your choice.
  • Mac OS 10.8 Mountain Lion or newer: run Docker Quickstart terminal to start Docker Machine.
  • Windows 10: run Docker Desktop for Windows and start a terminal of your choice.
  • Windows 7 or 8: run Docker Quickstart Terminal to start Docker Machine.
  • Linux: no action required.

Note: Scroll the table horizontally to see the entire content.

CommandEffect
$ docker login images.sb.biodatacatalyst.nhlbi.nih.govThis returns a prompt for your Platform credentials, and then, if satisfied, gives you access to the Platform registry. Don't forget to add images.sb.biodatacatalyst.nhlbi.nih.gov to this command, or else the utility will attempt to log you in to the Docker Hub registry.

You should enter your authentication token in response to the password prompt, not your Platform password.
$ docker run -ti <image>This runs a Docker container on your local machine. <image> can be any image in Docker Hub or the Platform Image Registry that you have uploaded or have permission to access. The -ti flag makes the container run interactively.

If you are opening an image from Docker Hub, specify <image> using <docker_repository>[:tag], e.g. ubuntu.
If you are opening an image from the Platform registry, <image> should be specified using the format images.sb.biodatacatalyst.nhlbi.nih.gov/<username>/<repository_name>/[:tag], e.g images.sb.biodatacatalyst.nhlbi.nih.gov/rfranklin/samtools:v1.
$ docker ps -aThis lists all your Docker containers.
docker commit <container ID> images.sb.biodatacatalyst.nhlbi.nih.gov/<username>/<repository_name>[:tag]This takes an image (snapshot) of the container with ID <container ID>, and names the image with the format recognised by the Platform registry.
You can find the container ID of an image using docker ps -a.
$ docker imagesThis lists all your local Docker images.
$ docker tag <image> images.sb.biodatacatalyst.nhlbi.nih.gov/<username>/<repository_name>[:tag]This tags the image with a reference to
the BioData Catalyst powered by Seven Bridges registry.
$ docker push images.sb.biodatacatalyst.nhlbi.nih.gov/<username>/<repository_name>[:tag]This uploads your Docker image to the BioData Catalyst powered by Seven Bridges registry, so that the tool in it can be used on the Platform.
$ docker rmi images.sb.biodatacatalyst.nhlbi.nih.gov/<username>/<repository_name>[:tag]This removes the specified Docker image from your local machine
$ docker pull images.sb.biodatacatalyst.nhlbi.nih.gov/<username>/<repository_name>[:tag]This downloads the specified image from the Platform registry.
$ docker logout images.sb.biodatacatalyst.nhlbi.nih.govThis stops your connection to the Platform image registry.