---
updatedAt: 2025-11-10T22:39:12.000Z
agentTools:
  projectIndex: https://docs.cavatica.org/llms.txt
---

# Core Docker commands

This section contains core Docker commands for running containers and pushing images to the CAVATICA 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.*

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Command
      </th>
      <th>
        Effect
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        `$ docker login pgc-images.sbgenomics.com`
      </td>
      <td>
        This returns a prompt for your CAVATICA credentials, and then, if satisfied, gives you access to the CAVATICA registry. Don't forget to add `pgc-images.sbgenomics.com` to this command, or else the utility will attempt to log you in to the Docker Hub registry.

        <span style={{ color: "red" }}><b>You should enter [your authentication token](https://docs.cavatica.org/docs/get-your-authentication-token) in response to the password prompt, not your CAVATICA password. </b></span>
      </td>
    </tr>
    <tr>
      <td>
        `$ docker run -ti <image>`
      </td>
      <td>
        This runs a Docker container on your local machine. `<image>` can be any image in [Docker](https://hub.docker.com/account/signup/) Hub or the CAVATICA 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 CAVATICA registry, `<image>` should be specified using the format `pgc-images.sbgenomics.com/<username>/<repository_name>/[:tag]`, e.g `pgc-images.sbgenomics.com/rfranklin/samtools:v1`.
      </td>
    </tr>
    <tr>
      <td>
        `$ docker ps -a`
      </td>
      <td>
        This lists all your Docker containers.
      </td>
    </tr>
    <tr>
      <td>
        `docker commit <container ID> pgc-images.sbgenomics.com/<username>/<repository_name>[:tag]`
      </td>
      <td>
        This takes an image (snapshot) of the container with ID `<container ID>`, and names the image with the format recognised by the CAVATICA registry.\
        You can find the `container ID` of an image using `docker ps -a`.
      </td>
    </tr>
    <tr>
      <td>
        `$ docker images`
      </td>
      <td>
        This lists all your local Docker images.
      </td>
    </tr>
    <tr>
      <td>
        `$ docker tag <image> pgc-images.sbgenomics.com/<username>/<repository_name>[:tag]`
      </td>
      <td>
        This tags the image with a reference to\
        [the CAVATICA registry](https://docs.cavatica.org/docs/the-image-registry).
      </td>
    </tr>
    <tr>
      <td>
        `$ docker push pgc-images.sbgenomics.com/<username>/<repository_name>[:tag]`
      </td>
      <td>
        This uploads your Docker image to [the CAVATICA registry](https://docs.cavatica.org/docs/the-image-registry), so that the tool in it can be used on CAVATICA.
      </td>
    </tr>
    <tr>
      <td>
        `$ docker rmi pgc-images.sbgenomics.com/<username>/<repository_name>[:tag]`
      </td>
      <td>
        This removes the specified Docker image from your local machine
      </td>
    </tr>
    <tr>
      <td>
        `$ docker pull pgc-images.sbgenomics.com/<username>/<repository_name>[:tag]`
      </td>
      <td>
        This downloads the specified image from [the CAVATICA registry](https://docs.cavatica.org/docs/the-image-registry).
      </td>
    </tr>
    <tr>
      <td>
        `$ docker logout pgc-images.sbgenomics.com`
      </td>
      <td>
        This stops your connection to the CAVATICA image registry.
      </td>
    </tr>
  </tbody>
</Table>