{"_id":"5c41b47b50f633003edb5fc7","project":"55faf11ba62ba1170021a9a7","version":{"_id":"55faf11ba62ba1170021a9aa","project":"55faf11ba62ba1170021a9a7","__v":44,"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","59a555bccdbd85001bfb1442","5a2a81f688574d001e9934f5","5b080c8d7833b20003ddbb6f","5c222bed4bc358002f21459a","5c22412594a2a5005cc9e919","5c41ae1c33592700190a291e","5c8a525e2ba7b2003f9b153c"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"55faf958d0e22017005b8274","__v":8,"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":16,"slug":"bring-your-tools","title":"DOCKER"},"user":"5767bc73bb15f40e00a28777","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-01-18T11:11:55.825Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"This section contains core Docker commands for running containers and pushing images to the CGC images registry.\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"First make sure Docker is running\",\n  \"body\": \"* **Mac OS 10.10.3 Yosemite or newer**: run Docker for Mac and start a terminal of your choice.\\n* **Mac OS 10.8 Mountain Lion or newer**: run Docker Quickstart terminal to start Docker Machine.\\n* **Windows 10**: run Docker for Windows and start a terminal of your choice.\\n* **Windows 7** or **8**: run Docker Quickstart Terminal to start Docker Machine. \\n* **Linux**: no action required.\"\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 `images.sbgenomics.com` to this command, or else the utility will attempt to log you in to the Docker Hub registry.\\n\\nYou can enter your username in any of the following three ways:\\n* In the same format as when logging in to the CGC (including uppercase, periods etc.).\\n* In lower case, while replacing non-alphanumeric characters with underscores.\\n* As the email address you used to register for the account on the CGC.\\n\\n<span style=\\\"color:red\\\"><b>You should enter [your authentication token](doc:get-your-authentication-token) in response to the password prompt, <i>not your CGC password.</i></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 image registry, `<image>` should be specified using the format `images.sbgenomics.com/<user_name>/<project_name>/[:tag]`, e.g `images.sbgenomics.com/rfranklin/samtools:v1`.\",\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 image 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    \"4-0\": \"`$ docker images`\",\n    \"4-1\": \"This lists all your local Docker images.\",\n    \"5-0\": \"`$ docker tag <repository> cgc-images.sbgenomics.com/<repository>`\",\n    \"5-1\": \"This tags the image with a reference to [the CGC image 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 image registry](doc:the-cgc-image-registry), so that the tool in it can be used on the CGC.\",\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    \"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 cgc-images.sbgenomics.com`\",\n    \"9-1\": \"This terminates your connection to the CGC image registry.\"\n  },\n  \"cols\": 2,\n  \"rows\": 10\n}\n[/block]","excerpt":"","slug":"core-docker-commands","type":"basic","title":"Core Docker commands"}

Core Docker commands


This section contains core Docker commands for running containers and pushing images to the CGC images registry. [block:callout] { "type": "success", "title": "First make sure Docker is running", "body": "* **Mac OS 10.10.3 Yosemite or newer**: run Docker for Mac and start a terminal of your choice.\n* **Mac OS 10.8 Mountain Lion or newer**: run Docker Quickstart terminal to start Docker Machine.\n* **Windows 10**: run Docker for Windows and start a terminal of your choice.\n* **Windows 7** or **8**: run Docker Quickstart Terminal to start Docker Machine. \n* **Linux**: no action required." } [/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 `images.sbgenomics.com` to this command, or else the utility will attempt to log you in to the Docker Hub registry.\n\nYou can enter your username in any of the following three ways:\n* In the same format as when logging in to the CGC (including uppercase, periods etc.).\n* In lower case, while replacing non-alphanumeric characters with underscores.\n* As the email address you used to register for the account on the CGC.\n\n<span style=\"color:red\"><b>You should enter [your authentication token](doc:get-your-authentication-token) in response to the password prompt, <i>not your CGC password.</i></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 image registry, `<image>` should be specified using the format `images.sbgenomics.com/<user_name>/<project_name>/[:tag]`, e.g `images.sbgenomics.com/rfranklin/samtools:v1`.", "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 image registry.\nYou can find the `container ID` of an image using `docker ps -a`.\nRecall that `<repository>` has the form `<user_name>/<project_name>`.", "4-0": "`$ docker images`", "4-1": "This lists all your local Docker images.", "5-0": "`$ docker tag <repository> cgc-images.sbgenomics.com/<repository>`", "5-1": "This tags the image with a reference to [the CGC image 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 image registry](doc:the-cgc-image-registry), so that the tool in it can be used on the CGC.", "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>`.", "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 cgc-images.sbgenomics.com`", "9-1": "This terminates your connection to the CGC image registry." }, "cols": 2, "rows": 10 } [/block]