# Using Docker

## Why Docker?

* **Portability** - Run code and scripts on any machine that has Docker installed
  * Avoids installation headaches on multiple machines (dependencies are installed with software)
  * **Make it easy to run batch jobs on multiple instances**
* **Reproducibility** - be able to run code and generate the same outputs given a set of input files
  * **Tie all software to specific versions**
  * Utilize Docker images with multiple bioinformatics software installed
  * Examples: [Rocker Project](https://rocker-project.org/),  [GATK4](https://hub.docker.com/r/broadinstitute/gatk/)

## Docker Terms

* Docker Registries
  * Collection of repositories that hold container images
  * docker pull: pulls the images from a registry to a container on our machine
  * docker commit: When we commit changes, these changes are saved to the image in registry

![](/files/pfRlBFSXZ7SgNZo4Mo67)

## Snapshots vs Images on the Platform

There are hard limits for using Docker Images.

* DockerHub and other registries have a pull limit of 200 pulls/user/day
* Saving a snapshot file to your project lets you scale without these limits
* Especially helpful in batch processing

## Docker and Security

* Use images from trusted vendors whenever possible
  * Examples: Official Ubuntu Image, Amazon Linux Image, Biocontainers
  * Avoid "kitchen sink" images - hard to manage vulnerabilities
* In general: **pay attention to possible vulnerabilities and whether they affect your containers**&#x20;
* Use dockerfiles to uninstall/patch possible vulnerabilities in images

## Resources

[Full Documentation](https://documentation.dnanexus.com/)

To create a support ticket if there are technical issues:

1. Go to the Help header (same section where Projects and Tools are) inside the platform
2. Select "Contact Support"
3. Fill in the Subject and Message to submit a support ticket.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.dnanexus.com/docker/usingdocker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
