{"__v":5,"_id":"56ddf68dba70f50e0033c6df","category":{"__v":8,"_id":"55faf958d0e22017005b8274","pages":["56268b3cc2781f0d00364bc0","5637bfa84dbdd919001b277d","5637e6fe97666c0d008656b6","5637e74acfaa870d00cdeb7a","5637e764f7e3990d007b2c52","5640baf604c3eb0d006fc43c","56cccb6894c8f00b00b83f24","56ddf68dba70f50e0033c6df"],"project":"55faf11ba62ba1170021a9a7","version":"55faf11ba62ba1170021a9aa","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-17T17:33:12.687Z","from_sync":false,"order":13,"slug":"bring-your-tools","title":"BRING YOUR TOOLS"},"parentDoc":null,"project":"55faf11ba62ba1170021a9a7","user":"5613e4f8fdd08f2b00437620","version":{"__v":37,"_id":"55faf11ba62ba1170021a9aa","project":"55faf11ba62ba1170021a9a7","createdAt":"2015-09-17T16:58:03.490Z","releaseDate":"2015-09-17T16:58:03.490Z","categories":["55faf11ca62ba1170021a9ab","55faf8f4d0e22017005b8272","55faf91aa62ba1170021a9b5","55faf929a8a7770d00c2c0bd","55faf932a8a7770d00c2c0bf","55faf94b17b9d00d00969f47","55faf958d0e22017005b8274","55faf95fa8a7770d00c2c0c0","55faf96917b9d00d00969f48","55faf970a8a7770d00c2c0c1","55faf98c825d5f19001fa3a6","55faf99aa62ba1170021a9b8","55faf99fa62ba1170021a9b9","55faf9aa17b9d00d00969f49","55faf9b6a8a7770d00c2c0c3","55faf9bda62ba1170021a9ba","5604570090ee490d00440551","5637e8b2fbe1c50d008cb078","5649bb624fa1460d00780add","5671974d1b6b730d008b4823","5671979d60c8e70d006c9760","568e8eef70ca1f0d0035808e","56d0a2081ecc471500f1795e","56d4a0adde40c70b00823ea3","56d96b03dd90610b00270849","56fbb83d8f21c817002af880","573c811bee2b3b2200422be1","576bc92afb62dd20001cda85","5771811e27a5c20e00030dcd","5785191af3a10c0e009b75b0","57bdf84d5d48411900cd8dc0","57ff5c5dc135231700aed806","5804caf792398f0f00e77521","58458b4fba4f1c0f009692bb","586d3c287c6b5b2300c05055","58ef66d88646742f009a0216","58f5d52d7891630f00fe4e77"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-07T21:45:49.938Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"In order to use your own tools or workflows on the CGC, you should install them in individual images, and then push these to [the CGC Image Registry](doc:the-cgc-image-registry)  or to Docker Hub. You can use [Docker](doc:docker-basics)  to do this.\n\n# Installing Docker\nSince Docker only runs on Linux, you will need access to a Linux machine to upload your images. If you are running Linux on your computer, you can install Docker locally. If you are running OS X, you can install Docker Machine. This is a tool that installs a Linux virtual machine that runs Docker.\nFull installation instructions are below.\n\n1. [Installing Docker on Linux](upload-your-docker-image#section-installing-docker-on-linux)\n2. [Installing Docker on Mac OS 10.10.3 Yosemite or newer](upload-your-docker-image#section-docker-for-mac)\n3. [Installing Docker on Mac OS 10.8 Mountain Lion or newer](upload-your-docker-image#section-docker-toolbox)\n4. [Installing Docker on Windows 10 Pro, Enterprise and Education](upload-your-docker-image#section-docker-for-windows)\n5. [Installing Docker on Windows 7 or Windows 8](upload-your-docker-image#section-docker-toolbox)\n\n###Installing Docker on Linux\n1. If you are running Linux on your local machine you will need to install Docker directly. You should be logged in as a user with sudo privileges. First, you will need to ensure that you have the command line utility `cURL`. Do this by opening a terminal and typing:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ which curl\",\n      \"language\": \"text\",\n      \"name\": \"Step 1\"\n    }\n  ]\n}\n[/block]\nIf `cURL` is not installed, update your package manager and install it, using:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ sudo apt-get update\\n$ sudo apt-get install curl\",\n      \"language\": \"text\",\n      \"name\": \"Step 1.1\"\n    }\n  ]\n}\n[/block]\n2. Now that you have cURL, you can use it to get the latest Docker package:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ curl -fsSL https://get.docker.com/ | sh\",\n      \"language\": \"text\",\n      \"name\": \"Step 2\"\n    }\n  ]\n}\n[/block]\n3. Add your account to the `docker` group.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"sudo usermod -aG docker <your_username>\",\n      \"language\": \"text\",\n      \"name\": \"Step 3\"\n    }\n  ]\n}\n[/block]\nThis step is required to be able to run Docker commands as a non-root user. You will have to log out and log back in for the change to take effect.\n\n4. Now you should have Docker! Verify that it is installed by running the `hello-world` container:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker run hello-world\\n \\nUnable to find image 'hello-world:latest' locally\\nlatest: Pulling from library/hello-world\\nb901d36b6f2f: Pull complete \\n0a6ba66e537a: Pull complete \\nDigest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7\\nStatus: Downloaded newer image for hello-world:latest\\n\\n\\nHello from Docker.\\n\\nThis message shows that your installation appears to be working correctly.\",\n      \"language\": \"text\",\n      \"name\": \"Step 3\"\n    }\n  ]\n}\n[/block]\nSee the list of [Docker commands ](#section-docker-commands)below for instructions on using it to push images.\n\n\n###Installing Docker on OS X\n\nDetermine which version of OS X you are running and select an option:\n\n  * **Mac OS 10.10.3 Yosemite or newer** - Follow setup directions in the Docker for Mac section below.\n  * **Mac OS 10.8 Mountain Lion or newer** - Follow setup directions in the Docker Toolbox section below.\n\n####Docker for Mac\n\nDocker for Mac runs as a native Mac application and uses [xhyve](https://github.com/mist64/xhyve/) to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon. To install Docker for Mac, follow these steps:\n\n1. Download and install [Docker for Mac](https://docs.docker.com/docker-for-mac/).\nAfter the installation is complete, the Docker icon will be displayed in the menu bar.\n2. Click the Docker icon and you will see the **Docker is running** information.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e9ea471-d874f16-docker-for-mac-running.jpg\",\n        \"d874f16-docker-for-mac-running.jpg\",\n        583,\n        271,\n        \"#bcdde7\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\n3. To use Docker, open a terminal and enter the Docker commands listed below.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"To make sure Docker for Mac is always running:\\n1. Click the Docker icon in the menu bar in the upper right corner of your screen.\\n2. Choose **Preferences**.\\n3. Enable **Automatically start Docker when you log in**.\"\n}\n[/block]\n####Docker Toolbox\n\nIf you are running OS X Mountain Lion or newer, you can use Docker Machine, a tool that installs a lightweight Linux virtual machine made specifically for running Docker. It allows you to run Docker commands from your terminal on OS X, or from a 'Quickstart terminal' application on your computer.\n\n1. Docker Machine is shipped with Docker Toolbox, which you can download from docker.com/products/docker-toolbox. To install Docker Toolbox, follow the installation instructions shown on the screen.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/HVBniUqXQouoBgt8jKg3_docker-toolbox.png\",\n        \"docker-toolbox.png\",\n        \"1238\",\n        \"874\",\n        \"#d9101b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n2. Once you have completed the installation steps for Docker Toolbox, you're ready to create a new Docker virtual machine. You can do this in two ways: \n(a) using the Docker Machine 'Quickstart Terminal' application, or\n(b) using the command line. \n\n(a) If you are using the Quickstart Terminal app, then simply select it from your Launchpad. \n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/572fb0e-docker-quickstart-terminal.png\",\n        \"docker-quickstart-terminal.png\",\n        100,\n        77,\n        \"#706352\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\nThis opens a terminal like the one shown below. If you chose this option, skip ahead to learn about essential [Docker commands](#section-docker-commands).\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/0EgnKSkNTXWgAfVnXpSk_terminal-window.png\",\n        \"terminal-window.png\",\n        \"1896\",\n        \"820\",\n        \"#507dc0\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n(b) Alternatively, you can create a Docker virtual machine using the command line. To do this, don't click to open the Docker 'Quickstart Terminal' application, but instead open a terminal. Type `docker-machine --help` to see a list of commands. We'll use docker-machine create to make our virtual machine, and name the machine default. Use the command `docker-machine create --driver virtualbox default` to do this.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker-machine create --driver virtualbox default\\n \\nCreating machine...\\n(default) OUT | Creating VirtualBox VM...\\n(default) OUT | Creating SSH key...\\n(default) OUT | Starting VirtualBox VM...\\n(default) OUT | Starting VM...\\nWaiting for machine to be running, this may take a few minutes...\\nMachine is running, waiting for SSH to be available...\\nDetecting operating system of created instance...\\nDetecting the provisioner...\\nProvisioning created instance...\\nCopying certs to the local machine directory...\\nCopying certs to the remote machine...\\nSetting Docker configuration on the remote daemon...\\nTo see how to connect Docker to this machine, run: docker-machine env default\",\n      \"language\": \"text\",\n      \"name\": \"Step 2.b\"\n    }\n  ]\n}\n[/block]\n3. Use the option `ls` to list your Docker machines. You should see that your machine `default` is running:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker-machine ls\\nNAME       ACTIVE   DRIVER       STATE     URL                         SWARM\\ndefault    *        virtualbox   Running   tcp://192.168.99.100:2376\",\n      \"language\": \"text\",\n      \"name\": \"Step 3\"\n    }\n  ]\n}\n[/block]\n4. Next, you need to set some environment variables for the shell of your Docker machine. You can see which variables need setting by using the `env` option followed by option argument `default`, for your default machine:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker-machine env default \\nexport DOCKER_TLS_VERIFY=\\\"1\\\"\\nexport DOCKER_HOST=\\\"tcp://192.168.99.101:2376\\\"\\nexport DOCKER_CERT_PATH=\\\"/Users/rfranklin/.docker/machine/machines/default2\\\"\\nexport DOCKER_MACHINE_NAME=\\\"default2\\\"\\n# Run this command to configure your shell:\\n# eval \\\"$(docker-machine env default)\\\"\",\n      \"language\": \"text\",\n      \"name\": \"Step 4\"\n    }\n  ]\n}\n[/block]\n5. Set the variables using the command `eval \"$(docker-machine env default)\"`. Note that you will need to do this every time you start a new session. To set the variables persistently, add the command to your .bashrc file (or equivalent file if using a different shell).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ eval \\\"$(docker-machine env default)\\\"\",\n      \"language\": \"text\",\n      \"name\": \"Step 5\"\n    }\n  ]\n}\n[/block]\n6. That's it! Now you can use Docker commands, inside your Docker machine. Try `docker run hello-world`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker run hello-world\\nUnable to find image 'hello-world:latest' locally\\nlatest: Pulling from library/hello-world\\nb901d36b6f2f: Pull complete\\n0a6ba66e537a: Pull complete\\nDigest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7\\nStatus: Downloaded newer image for hello-world:latest\\n \\n \\nHello from Docker.\\n \\nThis message shows that your installation appears to be working correctly.\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n7. Whenever you want to use Docker, you need to start your Docker machine. Do this by either selecting the Docker Quickstart Terminal application from your Launchpad, or by using the docker-machine command (in which case, don't forget to set your environment variables) as follows.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker-machine start default\\n$ eval \\\"$(docker-machine env default)\\\"\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nSee the list of [Docker commands](#section-docker-commands) below.\n\n#Installing Docker on Windows\n\nDetermine which version of Windows you are running and select an option:\n\n  * **Windows 10 Pro, Enterprise, and Education (64bit)** - Follow setup directions in the **Docker for Windows** section below.\n  * **Windows 7 or Windows 8** - Follow setup directions in the **Docker Toolbox** section below.\n\n###Docker for Windows\n\nDocker for Windows runs as a native Windows application. It uses the Hyper-V feature of the Windows OS to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon.\n\nTo install Docker for Windows, follow these steps:\n\n1. Download and install [Docker for Windows](https://download.docker.com/win/stable/InstallDocker.msi).\n2. After installation is complete the screen prompting you to enable to the Hyper-V feature will be displayed. Click **Yes** to enable it.\n3. Restart your computer.\n4. Click the **Docker for Windows** icon on your desktop.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f398c59-docker-for-windows-desktop-icon.jpg\",\n        \"docker-for-windows-desktop-icon.jpg\",\n        97,\n        96,\n        \"#0d2127\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\n5. Open the terminal of your choice, and issue the following command: docker run `hello-world`. If the installation was successful you will see the confirmation message. \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/df202e5-docker-successfully-installed.png\",\n        \"docker-successfully-installed.png\",\n        1145,\n        746,\n        \"#042454\"\n      ],\n      \"border\": true\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"To make sure Docker for Windows is always running:\\n\\n1. Right-click Docker icon in the system tray.\\n2. Choose **Settings**.\\n3. Enable the **Start Docker when you log in** option.\"\n}\n[/block]\nSee the list of Docker commands below.\n\n###Docker Toolbox\n\nIf you are running Windows 7 or Windows 8, access Docker via Docker Toolbox. Docker Toolbox uses Docker Machine to create a Linux virtual machine which hosts Docker on your Windows system.\n\nTo install Docker Toolbox, follow these steps:\n\n1. Download [Docker Toolbox](https://github.com/docker/toolbox/releases/download/v1.12.2/DockerToolbox-1.12.2.exe).\n2. Click **DockerToolbox.exe** and follow the onscreen instructions.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e560e99-install-docker-toolbox1.jpg\",\n        \"install-docker-toolbox1.jpg\",\n        522,\n        405,\n        \"#dfdfe0\"\n      ]\n    }\n  ]\n}\n[/block]\nOnce the installation is completed, click the **Docker Quickstart Terminal** icon on your desktop.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3698249-849783b-docker-quickstart-terminal-icon.jpg\",\n        \"849783b-docker-quickstart-terminal-icon.jpg\",\n        64,\n        114,\n        \"#2ac0e7\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Please bear in mind you will need to start Docker Toolbox every time you want to use Docker.\"\n}\n[/block]\n#Docker commands\nThis page contains core Docker commands for running containers and pushing images to the CGC images registry.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"* **Docker on Mac OS 10.10.3 Yosemite or newer** run Docker for Mac and start a terminal of your choice.\\n* **Docker on Mac OS 10.8 Mountain Lion or newer** run Docker Machine, by opening Docker Quickstart terminal or by using the command docker-machine start default.\\n* **Windows 7** or **8**: run Docker Quickstart Terminal.\\n* **Windows 10**: run Docker for Windows and start a terminal of your choice.\\n* **Linux**: skip this step.\",\n  \"title\": \"Depending on your operating system, first make sure Docker is started\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Command\",\n    \"h-1\": \"Effect\",\n    \"0-0\": \"`$ docker login cgc-images.sbgenomics.com`\",\n    \"0-1\": \"This returns a prompt for your CGC credentials, and then, if satisfied, gives you access to the CGC registry. Don't forget to add `cgc-images.sbgenomics.com` to this command, or else the utility will attempt to log you in to the Docker Hub registry.\\n\\nNote that you should replace any spaces in your username with underscores.\\n\\n<span style=\\\"color:red\\\"><b>You should enter [your authentication token](doc:get-your-authentication-token) in response to the password prompt, not your CGC password. </b></span>\",\n    \"1-0\": \"`$ docker run -ti <image>`\",\n    \"1-1\": \"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 CGC image registry that you have uploaded or have permission to access. The `-ti` flag makes the container run, interactively.\\n\\nIf you are opening an image from Docker Hub, specify `<image> ` using `<Docker_repository>[:tag]`, e.g.` ubuntu`.\\nIf you are opening an image from the CGC registry, `<image>` should be specified using the format `cgc-images.sbgenomics.com/<user_name>/<project_name>/[:tag]`, e.g `cgc-images.sbgenomics.com/rfranklin/samtools:v1`.\\n\\n[See an example](#section-open-a-docker-image).\",\n    \"2-0\": \"`$ docker ps -a`\",\n    \"3-0\": \"`docker commit <container ID> cgc-images.sbgenomics.com/<repository>[:tag]`\",\n    \"2-1\": \"This lists all your Docker containers.\",\n    \"3-1\": \"This takes an image (snapshot) of the container with ID `<container ID>`, and names the image with the format recognised by the CGC registry.\\nYou can find the `container ID` of an image using `docker ps -a`.\\nRecall that `<repository>` has the form `<user_name>/<project_name>`.\\n\\n[See an example](#section-commit-the-image)\",\n    \"4-0\": \"`$ docker images`\",\n    \"4-1\": \"This lists all your local Docker images.\\n\\n[See an example.](#7)\",\n    \"5-0\": \"`$ docker tag <repository> cgc-images.sbgenomics.com/<repository>`\",\n    \"5-1\": \"This tags the image with a reference to\\n[the CGC registry](doc:the-cgc-image-registry).\",\n    \"6-0\": \"`$ docker push cgc-images.sbgenomics.com/<repository> [:tag]`\",\n    \"6-1\": \"This uploads your Docker image to [the CGC registry](doc:the-cgc-image-registry). , so that the tool in it can be used on the CGC.\\n\\n[See an example.](#section-push-your-image)\",\n    \"7-0\": \"`$ docker rmi cgc-images.sbgenomics.com/<image name>`\",\n    \"7-1\": \"This removes the specified Docker image from your local machine. Typically `image name` will have the format `<user_name>/<project_name>`. \\n\\n[See an example](#section-remove-a-local-docker-image).\",\n    \"8-0\": \"`$ docker pull cgc-images.sbgenomics.com/<repository>[:tag]`\",\n    \"8-1\": \"This downloads the specified image from [the CGC registry](doc:the-cgc-image-registry).\",\n    \"9-0\": \"`$ docker logout images.sbgenomics.com`\",\n    \"9-1\": \"This stops your connection to the Seven Bridges image registry.\"\n  },\n  \"cols\": 2,\n  \"rows\": 10\n}\n[/block]\n##Upload an image\n###The workflow for uploading an image is as follows:\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"* **Docker on Mac OS 10.10.3 Yosemite or newer** run Docker for Mac and start a terminal of your choice.\\n* **Docker on Mac OS 10.8 Mountain Lion or newer** run Docker Machine, by opening Docker Quickstart terminal or by using the command docker-machine start default.\\n* **Windows 7** or **8**: run Docker Quickstart Terminal.\\n* **Windows 10**: run Docker for Windows and start a terminal of your choice.\\n* **Linux**: skip this step.\",\n  \"title\": \"Depending on your operating system, first make sure Docker is running:\"\n}\n[/block]\n1. If you use OS X, first run Docker Machine, by opening the Docker Quickstart terminal or by using the command `docker-machine start default`. If you use Linux, skip this step;\n2. Run `docker login cgc-images.sbgenomics.com` and enter your CGC credentials. Don't forget: enter your username in lower case, replacing spaces with hyphens, and enter your [authentication token](doc:get-your-authentication-token) when prompted for a password.\n3. [Open a Docker base image](#section-open-a-docker-image) with docker run -ti;\n4. [Install your tools](#section-install-your-tools-inside-a-docker-container) on the image;\n5. [Commit your image](#section-commit-the-image);\n6. [Push your image](#section-push-your-image) to the CGC registry.\n\n###Open a Docker image\nIf you are installing a tool, you'll need to open a new [base image](doc:docker-basics) to install it on. On the other hand, if you are modifying a tool that you have already uploaded, you can open the image containing the tool from [the CGC registry](doc:the-cgc-image-registry).\nTo install a tool, start by opening a base image. This can be any base image from Docker Hub, but starting with a plain operating system image like Ubuntu is generally recommended. To use this base image, enter:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"docker run -ti ubuntu\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nTo open an image from the CGC registry, enter the repository that the image is stored in, followed by the image tag, separated by a colon. The repository has the format `<user_name>/<project_name>`. For example, if the user `rfranklin` wanted to open the image tagged `1.3` from her project `picard`, she would enter\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"docker-run -ti cgc-images.sbgenomics.com/rfranklin/picard:1.3\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n###Install your tools inside a Docker container\nInside a container you can install your chosen tool or modify an existing tool. Do this in the way that you would normally, using methods appropriate for your tool, e.g. `apt-get`. Files from the local host can be accessed in the directory `/mountedcwd`. So, if the software you want to install is stored in a remote repository, you can `git pull` your code and mount it into the container.\n\nWhen you've finished installing a tool, leave the container by typing `exit`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"root:::at:::container$ exit\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n###Commit the image\nAfter you exit the container, you can commit the image of it.\nFirst, list all your local containers, so that you can commit an image (snapshot) of the ubuntu container that you just created. The `-a` option here lists all containers, include those that are not currently running; you should see a container that was just created recently. This is the one you want.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker ps -a\\n\\nCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES\\n\\nc52b82b497eb        ubuntu              \\\"/bin/bash\\\"              2 minutes ago       Exited (0) 2 minutes ago                        kickass_liskov\\nae194ed75819        debian              \\\"/bin/bash\\\"              7 hours ago         Exited (0) 7 hours ago                          jovial_swanson\\n34ff1377fbee        hello-world         \\\"/hello\\\"                 26 hours ago        Exited (0) 26 weeks ago                         high_almeida\\n54240578230c        c0bfb9c8e377        \\\"/bin/sh -c '/usr/gam\\\"   26 hours ago        Exited (0) 26 weeks ago                         serene_pare\\n517904a42f3d        docker/whalesay     \\\"cowsay hhLinked Appl\\\"   27 hours ago        Exited (0) 27 weeks ago                         romantic_bhaskara\\n1aad55d740cd        docker/whalesay     \\\"cowsay docker/whales\\\"   27 hours ago        Exited (0) 27 weeks ago                         cocky_bhaskara\\n7bfb18e0d18a        hello-world         \\\"/hello\\\"                 28 hours ago        Exited (0) 28 weeks ago                         stupefied_williams\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"body\": \"If you have followed the Docker Quickstart, on their website, or used Docker in any other way, you might have already created some containers. You should see those listed too.\",\n  \"title\": \"Your local containers\"\n}\n[/block]\nGrab the `CONTAINER ID` of the `ubuntu image` that was created 2 minutes ago. It's `c52b82b497eb`.\nNow, we'll commit an image of that container. This also gives you the opportunity to name your image. You must name it with the format `cgc-images.sbgenomics.com/<user_name>/<project_name>[:tag`]. For example, if the user `rfranklin` wanted to commit her changes to a container in a repository corresponding to the project `picard`, with tag `1.4` she would name the image `cgc-images.sbgenomics.com/rfranklin/picard:1.4`.\n\nCommit the image as follows:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker commit c52b82b497eb cgc-images.sbgenomics.com/rfranklin/picard:1.4\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n<a name = \"7\">If you want to confirm that the image has been named, you can list all of your local images:\n</a>\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker images \\n\\nREPOSITORY                                TAG                 IMAGE ID            CREATED             VIRTUAL SIZE\\n\\ncgc-images.sbgenomics.com/rfranklin/picard    1.4                 0fe5d1d1aaec        10 minutes ago      125.1 MB\\nrfranklin/test                            latest              0fe5d1d1aaec        18 minutes ago      125.1 MB\\ndebian                                    latest              7a01cc5f27b1        7 hours ago         125.1 MB\\nubuntu                                    latest              6cc0fc2a5ee3        8 months ago        187.9 MB\\nhello-world                               latest              0a6ba66e537a        8 months ago        960 B\\ndocker/whalesay                           latest              ded5e192a685        8 months ago        247 MB\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n###Push your image\nTo push your image to the CGC image registry, run the command `docker push cgc-images.sbgenomics.com/<repository>[:tag]`, where `<repository>[:tag]` refers to the image that you have already committed. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker push cgc-images.sbgenomics.com/rfranklin/picard:1.4\\nThe push refers to a repository [cgc-images.sbgenomics.com/rfranklin/picard] (len: 1)\\ncontainer@root: pushed\\n1.4: digest: sha256:afc9023f29719ffd361cdcbc334fe4ec2c041997ee501a15a86ed7f6e9277008 size: 3990\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThe progress of the image upload will be shown in the terminal. When it has completed, you will see the message `pushed`.\n\n\n###Remove a local Docker image\nTo delete a Docker image, use `docker rmi cgc-images.sbgenomics.com/<image_name><:tag>`. For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$ docker rmi cgc-images.sbgenomics.com/rfranklin/picard:1\\nDeleted 02c8c0913b94a09053dccded886512b77fbd2ecbe18930d1b059bb573f13afd1\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]","excerpt":"<a name=\"top\"/>","slug":"upload-your-docker-image","type":"basic","title":"Upload your Docker image"}

Upload your Docker image

<a name="top"/>

In order to use your own tools or workflows on the CGC, you should install them in individual images, and then push these to [the CGC Image Registry](doc:the-cgc-image-registry) or to Docker Hub. You can use [Docker](doc:docker-basics) to do this. # Installing Docker Since Docker only runs on Linux, you will need access to a Linux machine to upload your images. If you are running Linux on your computer, you can install Docker locally. If you are running OS X, you can install Docker Machine. This is a tool that installs a Linux virtual machine that runs Docker. Full installation instructions are below. 1. [Installing Docker on Linux](upload-your-docker-image#section-installing-docker-on-linux) 2. [Installing Docker on Mac OS 10.10.3 Yosemite or newer](upload-your-docker-image#section-docker-for-mac) 3. [Installing Docker on Mac OS 10.8 Mountain Lion or newer](upload-your-docker-image#section-docker-toolbox) 4. [Installing Docker on Windows 10 Pro, Enterprise and Education](upload-your-docker-image#section-docker-for-windows) 5. [Installing Docker on Windows 7 or Windows 8](upload-your-docker-image#section-docker-toolbox) ###Installing Docker on Linux 1. If you are running Linux on your local machine you will need to install Docker directly. You should be logged in as a user with sudo privileges. First, you will need to ensure that you have the command line utility `cURL`. Do this by opening a terminal and typing: [block:code] { "codes": [ { "code": "$ which curl", "language": "text", "name": "Step 1" } ] } [/block] If `cURL` is not installed, update your package manager and install it, using: [block:code] { "codes": [ { "code": "$ sudo apt-get update\n$ sudo apt-get install curl", "language": "text", "name": "Step 1.1" } ] } [/block] 2. Now that you have cURL, you can use it to get the latest Docker package: [block:code] { "codes": [ { "code": "$ curl -fsSL https://get.docker.com/ | sh", "language": "text", "name": "Step 2" } ] } [/block] 3. Add your account to the `docker` group. [block:code] { "codes": [ { "code": "sudo usermod -aG docker <your_username>", "language": "text", "name": "Step 3" } ] } [/block] This step is required to be able to run Docker commands as a non-root user. You will have to log out and log back in for the change to take effect. 4. Now you should have Docker! Verify that it is installed by running the `hello-world` container: [block:code] { "codes": [ { "code": "$ docker run hello-world\n \nUnable to find image 'hello-world:latest' locally\nlatest: Pulling from library/hello-world\nb901d36b6f2f: Pull complete \n0a6ba66e537a: Pull complete \nDigest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7\nStatus: Downloaded newer image for hello-world:latest\n\n\nHello from Docker.\n\nThis message shows that your installation appears to be working correctly.", "language": "text", "name": "Step 3" } ] } [/block] See the list of [Docker commands ](#section-docker-commands)below for instructions on using it to push images. ###Installing Docker on OS X Determine which version of OS X you are running and select an option: * **Mac OS 10.10.3 Yosemite or newer** - Follow setup directions in the Docker for Mac section below. * **Mac OS 10.8 Mountain Lion or newer** - Follow setup directions in the Docker Toolbox section below. ####Docker for Mac Docker for Mac runs as a native Mac application and uses [xhyve](https://github.com/mist64/xhyve/) to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon. To install Docker for Mac, follow these steps: 1. Download and install [Docker for Mac](https://docs.docker.com/docker-for-mac/). After the installation is complete, the Docker icon will be displayed in the menu bar. 2. Click the Docker icon and you will see the **Docker is running** information. [block:image] { "images": [ { "image": [ "https://files.readme.io/e9ea471-d874f16-docker-for-mac-running.jpg", "d874f16-docker-for-mac-running.jpg", 583, 271, "#bcdde7" ], "border": true } ] } [/block] 3. To use Docker, open a terminal and enter the Docker commands listed below. [block:callout] { "type": "info", "body": "To make sure Docker for Mac is always running:\n1. Click the Docker icon in the menu bar in the upper right corner of your screen.\n2. Choose **Preferences**.\n3. Enable **Automatically start Docker when you log in**." } [/block] ####Docker Toolbox If you are running OS X Mountain Lion or newer, you can use Docker Machine, a tool that installs a lightweight Linux virtual machine made specifically for running Docker. It allows you to run Docker commands from your terminal on OS X, or from a 'Quickstart terminal' application on your computer. 1. Docker Machine is shipped with Docker Toolbox, which you can download from docker.com/products/docker-toolbox. To install Docker Toolbox, follow the installation instructions shown on the screen. [block:image] { "images": [ { "image": [ "https://files.readme.io/HVBniUqXQouoBgt8jKg3_docker-toolbox.png", "docker-toolbox.png", "1238", "874", "#d9101b", "" ] } ] } [/block] 2. Once you have completed the installation steps for Docker Toolbox, you're ready to create a new Docker virtual machine. You can do this in two ways: (a) using the Docker Machine 'Quickstart Terminal' application, or (b) using the command line. (a) If you are using the Quickstart Terminal app, then simply select it from your Launchpad. [block:image] { "images": [ { "image": [ "https://files.readme.io/572fb0e-docker-quickstart-terminal.png", "docker-quickstart-terminal.png", 100, 77, "#706352" ], "border": true } ] } [/block] This opens a terminal like the one shown below. If you chose this option, skip ahead to learn about essential [Docker commands](#section-docker-commands). [block:image] { "images": [ { "image": [ "https://files.readme.io/0EgnKSkNTXWgAfVnXpSk_terminal-window.png", "terminal-window.png", "1896", "820", "#507dc0", "" ] } ] } [/block] (b) Alternatively, you can create a Docker virtual machine using the command line. To do this, don't click to open the Docker 'Quickstart Terminal' application, but instead open a terminal. Type `docker-machine --help` to see a list of commands. We'll use docker-machine create to make our virtual machine, and name the machine default. Use the command `docker-machine create --driver virtualbox default` to do this. [block:code] { "codes": [ { "code": "$ docker-machine create --driver virtualbox default\n \nCreating machine...\n(default) OUT | Creating VirtualBox VM...\n(default) OUT | Creating SSH key...\n(default) OUT | Starting VirtualBox VM...\n(default) OUT | Starting VM...\nWaiting for machine to be running, this may take a few minutes...\nMachine is running, waiting for SSH to be available...\nDetecting operating system of created instance...\nDetecting the provisioner...\nProvisioning created instance...\nCopying certs to the local machine directory...\nCopying certs to the remote machine...\nSetting Docker configuration on the remote daemon...\nTo see how to connect Docker to this machine, run: docker-machine env default", "language": "text", "name": "Step 2.b" } ] } [/block] 3. Use the option `ls` to list your Docker machines. You should see that your machine `default` is running: [block:code] { "codes": [ { "code": "$ docker-machine ls\nNAME ACTIVE DRIVER STATE URL SWARM\ndefault * virtualbox Running tcp://192.168.99.100:2376", "language": "text", "name": "Step 3" } ] } [/block] 4. Next, you need to set some environment variables for the shell of your Docker machine. You can see which variables need setting by using the `env` option followed by option argument `default`, for your default machine: [block:code] { "codes": [ { "code": "$ docker-machine env default \nexport DOCKER_TLS_VERIFY=\"1\"\nexport DOCKER_HOST=\"tcp://192.168.99.101:2376\"\nexport DOCKER_CERT_PATH=\"/Users/rfranklin/.docker/machine/machines/default2\"\nexport DOCKER_MACHINE_NAME=\"default2\"\n# Run this command to configure your shell:\n# eval \"$(docker-machine env default)\"", "language": "text", "name": "Step 4" } ] } [/block] 5. Set the variables using the command `eval "$(docker-machine env default)"`. Note that you will need to do this every time you start a new session. To set the variables persistently, add the command to your .bashrc file (or equivalent file if using a different shell). [block:code] { "codes": [ { "code": "$ eval \"$(docker-machine env default)\"", "language": "text", "name": "Step 5" } ] } [/block] 6. That's it! Now you can use Docker commands, inside your Docker machine. Try `docker run hello-world`. [block:code] { "codes": [ { "code": "$ docker run hello-world\nUnable to find image 'hello-world:latest' locally\nlatest: Pulling from library/hello-world\nb901d36b6f2f: Pull complete\n0a6ba66e537a: Pull complete\nDigest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7\nStatus: Downloaded newer image for hello-world:latest\n \n \nHello from Docker.\n \nThis message shows that your installation appears to be working correctly.", "language": "text" } ] } [/block] 7. Whenever you want to use Docker, you need to start your Docker machine. Do this by either selecting the Docker Quickstart Terminal application from your Launchpad, or by using the docker-machine command (in which case, don't forget to set your environment variables) as follows. [block:code] { "codes": [ { "code": "$ docker-machine start default\n$ eval \"$(docker-machine env default)\"", "language": "text" } ] } [/block] See the list of [Docker commands](#section-docker-commands) below. #Installing Docker on Windows Determine which version of Windows you are running and select an option: * **Windows 10 Pro, Enterprise, and Education (64bit)** - Follow setup directions in the **Docker for Windows** section below. * **Windows 7 or Windows 8** - Follow setup directions in the **Docker Toolbox** section below. ###Docker for Windows Docker for Windows runs as a native Windows application. It uses the Hyper-V feature of the Windows OS to virtualize the Docker Engine environment and Linux kernel-specific features for the Docker daemon. To install Docker for Windows, follow these steps: 1. Download and install [Docker for Windows](https://download.docker.com/win/stable/InstallDocker.msi). 2. After installation is complete the screen prompting you to enable to the Hyper-V feature will be displayed. Click **Yes** to enable it. 3. Restart your computer. 4. Click the **Docker for Windows** icon on your desktop. [block:image] { "images": [ { "image": [ "https://files.readme.io/f398c59-docker-for-windows-desktop-icon.jpg", "docker-for-windows-desktop-icon.jpg", 97, 96, "#0d2127" ], "border": true } ] } [/block] 5. Open the terminal of your choice, and issue the following command: docker run `hello-world`. If the installation was successful you will see the confirmation message. [block:image] { "images": [ { "image": [ "https://files.readme.io/df202e5-docker-successfully-installed.png", "docker-successfully-installed.png", 1145, 746, "#042454" ], "border": true } ] } [/block] [block:callout] { "type": "info", "body": "To make sure Docker for Windows is always running:\n\n1. Right-click Docker icon in the system tray.\n2. Choose **Settings**.\n3. Enable the **Start Docker when you log in** option." } [/block] See the list of Docker commands below. ###Docker Toolbox If you are running Windows 7 or Windows 8, access Docker via Docker Toolbox. Docker Toolbox uses Docker Machine to create a Linux virtual machine which hosts Docker on your Windows system. To install Docker Toolbox, follow these steps: 1. Download [Docker Toolbox](https://github.com/docker/toolbox/releases/download/v1.12.2/DockerToolbox-1.12.2.exe). 2. Click **DockerToolbox.exe** and follow the onscreen instructions. [block:image] { "images": [ { "image": [ "https://files.readme.io/e560e99-install-docker-toolbox1.jpg", "install-docker-toolbox1.jpg", 522, 405, "#dfdfe0" ] } ] } [/block] Once the installation is completed, click the **Docker Quickstart Terminal** icon on your desktop. [block:image] { "images": [ { "image": [ "https://files.readme.io/3698249-849783b-docker-quickstart-terminal-icon.jpg", "849783b-docker-quickstart-terminal-icon.jpg", 64, 114, "#2ac0e7" ] } ] } [/block] [block:callout] { "type": "info", "body": "Please bear in mind you will need to start Docker Toolbox every time you want to use Docker." } [/block] #Docker commands This page contains core Docker commands for running containers and pushing images to the CGC images registry. [block:callout] { "type": "success", "body": "* **Docker on Mac OS 10.10.3 Yosemite or newer** run Docker for Mac and start a terminal of your choice.\n* **Docker on Mac OS 10.8 Mountain Lion or newer** run Docker Machine, by opening Docker Quickstart terminal or by using the command docker-machine start default.\n* **Windows 7** or **8**: run Docker Quickstart Terminal.\n* **Windows 10**: run Docker for Windows and start a terminal of your choice.\n* **Linux**: skip this step.", "title": "Depending on your operating system, first make sure Docker is started" } [/block] [block:parameters] { "data": { "h-0": "Command", "h-1": "Effect", "0-0": "`$ docker login cgc-images.sbgenomics.com`", "0-1": "This returns a prompt for your CGC credentials, and then, if satisfied, gives you access to the CGC registry. Don't forget to add `cgc-images.sbgenomics.com` to this command, or else the utility will attempt to log you in to the Docker Hub registry.\n\nNote that you should replace any spaces in your username with underscores.\n\n<span style=\"color:red\"><b>You should enter [your authentication token](doc:get-your-authentication-token) in response to the password prompt, not your CGC password. </b></span>", "1-0": "`$ docker run -ti <image>`", "1-1": "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 CGC image registry that you have uploaded or have permission to access. The `-ti` flag makes the container run, interactively.\n\nIf you are opening an image from Docker Hub, specify `<image> ` using `<Docker_repository>[:tag]`, e.g.` ubuntu`.\nIf you are opening an image from the CGC registry, `<image>` should be specified using the format `cgc-images.sbgenomics.com/<user_name>/<project_name>/[:tag]`, e.g `cgc-images.sbgenomics.com/rfranklin/samtools:v1`.\n\n[See an example](#section-open-a-docker-image).", "2-0": "`$ docker ps -a`", "3-0": "`docker commit <container ID> cgc-images.sbgenomics.com/<repository>[:tag]`", "2-1": "This lists all your Docker containers.", "3-1": "This takes an image (snapshot) of the container with ID `<container ID>`, and names the image with the format recognised by the CGC registry.\nYou can find the `container ID` of an image using `docker ps -a`.\nRecall that `<repository>` has the form `<user_name>/<project_name>`.\n\n[See an example](#section-commit-the-image)", "4-0": "`$ docker images`", "4-1": "This lists all your local Docker images.\n\n[See an example.](#7)", "5-0": "`$ docker tag <repository> cgc-images.sbgenomics.com/<repository>`", "5-1": "This tags the image with a reference to\n[the CGC registry](doc:the-cgc-image-registry).", "6-0": "`$ docker push cgc-images.sbgenomics.com/<repository> [:tag]`", "6-1": "This uploads your Docker image to [the CGC registry](doc:the-cgc-image-registry). , so that the tool in it can be used on the CGC.\n\n[See an example.](#section-push-your-image)", "7-0": "`$ docker rmi cgc-images.sbgenomics.com/<image name>`", "7-1": "This removes the specified Docker image from your local machine. Typically `image name` will have the format `<user_name>/<project_name>`. \n\n[See an example](#section-remove-a-local-docker-image).", "8-0": "`$ docker pull cgc-images.sbgenomics.com/<repository>[:tag]`", "8-1": "This downloads the specified image from [the CGC registry](doc:the-cgc-image-registry).", "9-0": "`$ docker logout images.sbgenomics.com`", "9-1": "This stops your connection to the Seven Bridges image registry." }, "cols": 2, "rows": 10 } [/block] ##Upload an image ###The workflow for uploading an image is as follows: [block:callout] { "type": "success", "body": "* **Docker on Mac OS 10.10.3 Yosemite or newer** run Docker for Mac and start a terminal of your choice.\n* **Docker on Mac OS 10.8 Mountain Lion or newer** run Docker Machine, by opening Docker Quickstart terminal or by using the command docker-machine start default.\n* **Windows 7** or **8**: run Docker Quickstart Terminal.\n* **Windows 10**: run Docker for Windows and start a terminal of your choice.\n* **Linux**: skip this step.", "title": "Depending on your operating system, first make sure Docker is running:" } [/block] 1. If you use OS X, first run Docker Machine, by opening the Docker Quickstart terminal or by using the command `docker-machine start default`. If you use Linux, skip this step; 2. Run `docker login cgc-images.sbgenomics.com` and enter your CGC credentials. Don't forget: enter your username in lower case, replacing spaces with hyphens, and enter your [authentication token](doc:get-your-authentication-token) when prompted for a password. 3. [Open a Docker base image](#section-open-a-docker-image) with docker run -ti; 4. [Install your tools](#section-install-your-tools-inside-a-docker-container) on the image; 5. [Commit your image](#section-commit-the-image); 6. [Push your image](#section-push-your-image) to the CGC registry. ###Open a Docker image If you are installing a tool, you'll need to open a new [base image](doc:docker-basics) to install it on. On the other hand, if you are modifying a tool that you have already uploaded, you can open the image containing the tool from [the CGC registry](doc:the-cgc-image-registry). To install a tool, start by opening a base image. This can be any base image from Docker Hub, but starting with a plain operating system image like Ubuntu is generally recommended. To use this base image, enter: [block:code] { "codes": [ { "code": "docker run -ti ubuntu", "language": "text" } ] } [/block] To open an image from the CGC registry, enter the repository that the image is stored in, followed by the image tag, separated by a colon. The repository has the format `<user_name>/<project_name>`. For example, if the user `rfranklin` wanted to open the image tagged `1.3` from her project `picard`, she would enter [block:code] { "codes": [ { "code": "docker-run -ti cgc-images.sbgenomics.com/rfranklin/picard:1.3", "language": "text" } ] } [/block] ###Install your tools inside a Docker container Inside a container you can install your chosen tool or modify an existing tool. Do this in the way that you would normally, using methods appropriate for your tool, e.g. `apt-get`. Files from the local host can be accessed in the directory `/mountedcwd`. So, if the software you want to install is stored in a remote repository, you can `git pull` your code and mount it into the container. When you've finished installing a tool, leave the container by typing `exit`. [block:code] { "codes": [ { "code": "root@container$ exit", "language": "text" } ] } [/block] ###Commit the image After you exit the container, you can commit the image of it. First, list all your local containers, so that you can commit an image (snapshot) of the ubuntu container that you just created. The `-a` option here lists all containers, include those that are not currently running; you should see a container that was just created recently. This is the one you want. [block:code] { "codes": [ { "code": "$ docker ps -a\n\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n\nc52b82b497eb ubuntu \"/bin/bash\" 2 minutes ago Exited (0) 2 minutes ago kickass_liskov\nae194ed75819 debian \"/bin/bash\" 7 hours ago Exited (0) 7 hours ago jovial_swanson\n34ff1377fbee hello-world \"/hello\" 26 hours ago Exited (0) 26 weeks ago high_almeida\n54240578230c c0bfb9c8e377 \"/bin/sh -c '/usr/gam\" 26 hours ago Exited (0) 26 weeks ago serene_pare\n517904a42f3d docker/whalesay \"cowsay hhLinked Appl\" 27 hours ago Exited (0) 27 weeks ago romantic_bhaskara\n1aad55d740cd docker/whalesay \"cowsay docker/whales\" 27 hours ago Exited (0) 27 weeks ago cocky_bhaskara\n7bfb18e0d18a hello-world \"/hello\" 28 hours ago Exited (0) 28 weeks ago stupefied_williams", "language": "text" } ] } [/block] [block:callout] { "type": "success", "body": "If you have followed the Docker Quickstart, on their website, or used Docker in any other way, you might have already created some containers. You should see those listed too.", "title": "Your local containers" } [/block] Grab the `CONTAINER ID` of the `ubuntu image` that was created 2 minutes ago. It's `c52b82b497eb`. Now, we'll commit an image of that container. This also gives you the opportunity to name your image. You must name it with the format `cgc-images.sbgenomics.com/<user_name>/<project_name>[:tag`]. For example, if the user `rfranklin` wanted to commit her changes to a container in a repository corresponding to the project `picard`, with tag `1.4` she would name the image `cgc-images.sbgenomics.com/rfranklin/picard:1.4`. Commit the image as follows: [block:code] { "codes": [ { "code": "$ docker commit c52b82b497eb cgc-images.sbgenomics.com/rfranklin/picard:1.4", "language": "text" } ] } [/block] <a name = "7">If you want to confirm that the image has been named, you can list all of your local images: </a> [block:code] { "codes": [ { "code": "$ docker images \n\nREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE\n\ncgc-images.sbgenomics.com/rfranklin/picard 1.4 0fe5d1d1aaec 10 minutes ago 125.1 MB\nrfranklin/test latest 0fe5d1d1aaec 18 minutes ago 125.1 MB\ndebian latest 7a01cc5f27b1 7 hours ago 125.1 MB\nubuntu latest 6cc0fc2a5ee3 8 months ago 187.9 MB\nhello-world latest 0a6ba66e537a 8 months ago 960 B\ndocker/whalesay latest ded5e192a685 8 months ago 247 MB", "language": "text" } ] } [/block] ###Push your image To push your image to the CGC image registry, run the command `docker push cgc-images.sbgenomics.com/<repository>[:tag]`, where `<repository>[:tag]` refers to the image that you have already committed. For example: [block:code] { "codes": [ { "code": "$ docker push cgc-images.sbgenomics.com/rfranklin/picard:1.4\nThe push refers to a repository [cgc-images.sbgenomics.com/rfranklin/picard] (len: 1)\ncontainer@root: pushed\n1.4: digest: sha256:afc9023f29719ffd361cdcbc334fe4ec2c041997ee501a15a86ed7f6e9277008 size: 3990", "language": "text" } ] } [/block] The progress of the image upload will be shown in the terminal. When it has completed, you will see the message `pushed`. ###Remove a local Docker image To delete a Docker image, use `docker rmi cgc-images.sbgenomics.com/<image_name><:tag>`. For example: [block:code] { "codes": [ { "code": "$ docker rmi cgc-images.sbgenomics.com/rfranklin/picard:1\nDeleted 02c8c0913b94a09053dccded886512b77fbd2ecbe18930d1b059bb573f13afd1", "language": "text" } ] } [/block]