{"id":9283,"date":"2019-02-08T06:52:49","date_gmt":"2019-02-08T06:52:49","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=9283"},"modified":"2019-02-10T06:52:41","modified_gmt":"2019-02-10T06:52:41","slug":"15-docker-commands-you-should-know-linux-com","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/02\/08\/15-docker-commands-you-should-know-linux-com\/","title":{"rendered":"15 Docker Commands You Should Know | Linux.com"},"content":{"rendered":"<div class=\"section-inner sectionLayout--insetColumn\">\n<p id=\"0598\" class=\"graf graf--p graf-after--h4\">In this article we\u2019ll look at 15 Docker CLI commands you should know. If you haven\u2019t yet, check out the rest of this series on\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-b7ba70caeb4b\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-b7ba70caeb4b\">Docker concepts<\/a>,\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-1c40ea269fa8\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-1c40ea269fa8\">the ecosystem<\/a>,\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-b0b44222eef5\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-b0b44222eef5\">Dockerfiles<\/a>, and\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/towardsdatascience.com\/slimming-down-your-docker-images-275f0ca9337e\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/towardsdatascience.com\/slimming-down-your-docker-images-275f0ca9337e\">keeping your images slim<\/a>. In Part 6 we\u2019ll explore data with Docker. I\u2019ve got a series on Kubernetes in the works too, so follow me to make sure you don\u2019t miss the fun!<\/p>\n<p id=\"ab8b\" class=\"graf graf--p graf-after--p\">There are about a billion Docker commands (give or take a billion). The\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/cli\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/cli\/\">Docker docs<\/a>\u00a0are extensive, but overwhelming when you\u2019re just getting started. In this article I\u2019ll highlight the key commands for running vanilla Docker.<\/p>\n<div class=\"section-inner sectionLayout--insetColumn\">\n<p id=\"ff37\" class=\"graf graf--p graf-after--figure\">At risk of taking the food metaphor thread running through these articles too far, let\u2019s use a fruit theme. Veggies provided sustenance in the\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/towardsdatascience.com\/slimming-down-your-docker-images-275f0ca9337e\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/towardsdatascience.com\/slimming-down-your-docker-images-275f0ca9337e\">article on slimming down our images<\/a>. Now tasty fruits will give us nutrients as we learn our key Docker commands.<\/p>\n<h3 id=\"a230\" class=\"graf graf--h3 graf-after--p\">Overview<\/h3>\n<p id=\"6853\" class=\"graf graf--p graf-after--h3\">Recall that a Docker image is made of a Dockerfile + any necessary dependencies. Also recall that a Docker container is a Docker image brought to life. To work with Docker commands, you first need to know whether you\u2019re dealing with an image or a container.<\/p>\n<ul class=\"postList\">\n<li id=\"74e4\" class=\"graf graf--li graf-after--p\"><strong class=\"markup--strong markup--li-strong\">A Docker image either exists or it doesn\u2019t.<\/strong><\/li>\n<li id=\"7c9a\" class=\"graf graf--li graf-after--li\"><strong class=\"markup--strong markup--li-strong\">A Docker container either exists or it doesn\u2019t.<\/strong><\/li>\n<li id=\"b7f2\" class=\"graf graf--li graf-after--li\"><strong class=\"markup--strong markup--li-strong\">A Docker container that exists is either running or it isn\u2019t.<\/strong><\/li>\n<\/ul>\n<p id=\"0635\" class=\"graf graf--p graf-after--li\">Once you know what you\u2019re working with you can find the right command for the job.<\/p>\n<h4 id=\"1ab6\" class=\"graf graf--h4 graf-after--p\">Commmand Commonalities<\/h4>\n<p id=\"94ce\" class=\"graf graf--p graf-after--h4\">Here are a few things to know about Docker commands:<\/p>\n<ul class=\"postList\">\n<li id=\"fd62\" class=\"graf graf--li graf-after--p\">Docker CLI management commands start with\u00a0<code class=\"markup--code markup--li-code\">docker<\/code>, then a space, then the management category, then a space, and then the command. For example,\u00a0<code class=\"markup--code markup--li-code\">docker container stop<\/code>\u00a0stops a container.<\/li>\n<li id=\"826c\" class=\"graf graf--li graf-after--li\">A command referring to a specific container or image requires the name or id of that container or image.<\/li>\n<\/ul>\n<p id=\"0198\" class=\"graf graf--p graf-after--li\">For example,\u00a0<code class=\"markup--code markup--p-code\">docker container run my_app<\/code>\u00a0is the command to build and run the container named\u00a0<em class=\"markup--em markup--p-em\">my_app<\/em>. I\u2019ll use the name\u00a0<code class=\"markup--code markup--p-code\">my_container<\/code>\u00a0to refer to a generic container throughout the examples. Same goes for\u00a0<code class=\"markup--code markup--p-code\">my_image<\/code>,\u00a0<code class=\"markup--code markup--p-code\">my_tag<\/code>, etc.<\/p>\n<p id=\"6327\" class=\"graf graf--p graf-after--p\">I\u2019ll provide the command alone and then with common flags, if applicable. A flag with two dashes in front is the full name of the flag. A flag with one dash is a shortcut for the full flag name. For example,\u00a0<code class=\"markup--code markup--p-code\">-p<\/code>\u00a0is short for the\u00a0<code class=\"markup--code markup--p-code\">--port<\/code>flag.<\/p>\n<\/div>\n<div class=\"section-inner sectionLayout--outsetColumn\">\n<figure id=\"1e47\" class=\"graf graf--figure graf--layoutOutsetCenter graf-after--p\" data-scroll=\"native\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*GXCbJUG6G2EgcUAA4oxX2Q.png\" data-width=\"640\" data-height=\"320\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"37\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/2000\/1*GXCbJUG6G2EgcUAA4oxX2Q.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/2000\/1*GXCbJUG6G2EgcUAA4oxX2Q.png\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Flags provide options to\u00a0commands<\/figcaption><\/figure>\n<\/div>\n<div class=\"section-inner sectionLayout--insetColumn\">\n<p id=\"fd74\" class=\"graf graf--p graf-after--figure\">The goal is to help these commands and flags stick in your memory and for this guide to serve as a reference. This guide is current for Linux and Docker Engine Version 18.09.1 and API\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/docs.docker.com\/engine\/api\/version-history\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.docker.com\/engine\/api\/version-history\/\">version 1.39<\/a>.<\/p>\n<p id=\"3d0c\" class=\"graf graf--p graf-after--p\">First, we\u2019ll look at commands for containers and then we\u2019ll look at commands for images. Volumes will be covered in the next article. Here\u2019s the list of 15 commands to know\u200a\u2014\u200aplus 3 bonus commands!<\/p>\n<h4 id=\"27f3\" class=\"graf graf--h4 graf-after--p\">Containers<\/h4>\n<p id=\"5de2\" class=\"graf graf--p graf-after--h4\">Use\u00a0<code class=\"markup--code markup--p-code\">docker container my_command<\/code><\/p>\n<p id=\"df7e\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">create<\/code>\u200a\u2014\u200aCreate a container from an image.<br \/>\n<code class=\"markup--code markup--p-code\">start\u200a<\/code>\u2014\u200aStart an existing container.<br \/>\n<code class=\"markup--code markup--p-code\">run<\/code>\u200a\u2014\u200aCreate a new container and start it.<br \/>\n<code class=\"markup--code markup--p-code\">ls<\/code>\u200a\u2014\u200aList running<em class=\"markup--em markup--p-em\">\u00a0<\/em>containers.<br \/>\n<code class=\"markup--code markup--p-code\">inspect<\/code>\u200a\u2014\u200aSee lots of info about a container.<br \/>\n<code class=\"markup--code markup--p-code\">logs<\/code>\u200a\u2014\u200aPrint logs.<br \/>\n<code class=\"markup--code markup--p-code\">stop<\/code>\u200a\u2014\u200aGracefully stop running container.<br \/>\n<code class=\"markup--code markup--p-code\">kill<\/code>\u00a0\u2014Stop main process in container abruptly.<br \/>\n<code class=\"markup--code markup--p-code\">rm<\/code>\u2014 Delete a stopped container.<\/p>\n<h4 id=\"3884\" class=\"graf graf--h4 graf-after--p\">Images<\/h4>\n<p id=\"4d55\" class=\"graf graf--p graf-after--h4\">Use\u00a0<code class=\"markup--code markup--p-code\">docker image my_command<\/code><\/p>\n<p id=\"9832\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">build\u200a<\/code>\u2014\u200aBuild an image.<br \/>\n<code class=\"markup--code markup--p-code\">push<\/code>\u200a\u2014\u200aPush an image to a remote registry.<br \/>\n<code class=\"markup--code markup--p-code\">ls<\/code>\u200a\u2014\u200aList images.<br \/>\n<code class=\"markup--code markup--p-code\">history<\/code>\u200a\u2014\u200aSee intermediate image info.<br \/>\n<code class=\"markup--code markup--p-code\">inspect<\/code>\u200a\u2014\u200aSee lots of info about an image, including the layers.<br \/>\n<code class=\"markup--code markup--p-code\">rm<\/code>\u200a\u2014\u200aDelete an image.<\/p>\n<h4 id=\"f265\" class=\"graf graf--h4 graf-after--p\">Misc<\/h4>\n<p id=\"7d4c\" class=\"graf graf--p graf-after--h4\"><code class=\"markup--code markup--p-code\">docker version<\/code>\u200a\u2014\u200aList info about your Docker Client and Server versions.<br \/>\n<code class=\"markup--code markup--p-code\">docker login\u200a<\/code>\u2014\u200aLog in to a Docker registry.<br \/>\n<code class=\"markup--code markup--p-code\">docker system prune<\/code>\u200a\u2014\u200aDelete all unused containers, unused networks, and dangling images.<\/p>\n<h3 id=\"a068\" class=\"graf graf--h3 graf-after--p\">Containers<\/h3>\n<h4 id=\"fda9\" class=\"graf graf--h4 graf-after--h3\">Container Beginnings<\/h4>\n<p id=\"7aad\" class=\"graf graf--p graf-after--h4\">The terms create, start, and run all have similar semantics in everyday life. But each is a separate Docker command that creates and\/or starts a container. Let\u2019s look at creating a container first.<\/p>\n<p id=\"305f\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container create my_repo\/my_image:my_tag<\/strong><\/code>\u200a\u2014\u200aCreate a container from an image.<\/p>\n<p id=\"c599\" class=\"graf graf--p graf-after--p\">I\u2019ll shorten\u00a0<code class=\"markup--code markup--p-code\">my_repo\/my_image:my_tag<\/code><strong class=\"markup--strong markup--p-strong\">\u00a0<\/strong>to\u00a0<code class=\"markup--code markup--p-code\">my_image<\/code>\u00a0for the rest of the article.<\/p>\n<p id=\"2b6e\" class=\"graf graf--p graf-after--p\">There are\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/create\/#parent-command\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/create\/#parent-command\">a lot of possible flags<\/a>\u00a0you could pass to\u00a0<code class=\"markup--code markup--p-code\">create<\/code>.<\/p>\n<p id=\"0336\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container create -a STDIN my_image<\/strong><\/code><\/p>\n<p id=\"ebf0\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-a<\/code>\u00a0is short for\u00a0<code class=\"markup--code markup--p-code\">--attach<\/code>. Attach the container to STDIN, STDOUT or STDERR.<\/p>\n<p id=\"013c\" class=\"graf graf--p graf-after--p\">Now that we\u2019ve created a container let\u2019s start it.<\/p>\n<p id=\"b734\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container start my_container<\/strong><\/code>\u200a\u2014\u200aStart an existing container.<\/p>\n<p id=\"9a3b\" class=\"graf graf--p graf-after--p\">Note that the container can be referred to by either the container\u2019s ID or the container\u2019s name.<\/p>\n<p id=\"df41\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container start my_container<\/strong><\/code><\/p>\n<\/div>\n<div class=\"section-inner sectionLayout--outsetColumn\">\n<figure id=\"e96e\" class=\"graf graf--figure graf--layoutOutsetCenter graf-after--p\" data-scroll=\"native\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*hdLjLfbTWcXQIjgy2D2t0A.jpeg\" data-width=\"640\" data-height=\"426\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"48\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/2000\/1*hdLjLfbTWcXQIjgy2D2t0A.jpeg\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/2000\/1*hdLjLfbTWcXQIjgy2D2t0A.jpeg\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Start<\/figcaption><\/figure>\n<\/div>\n<div class=\"section-inner sectionLayout--insetColumn\">\n<p id=\"39cf\" class=\"graf graf--p graf-after--figure\">Now that you know how to create and start a container, let\u2019s turn to what\u2019s probably the most common Docker command. It combines both\u00a0<code class=\"markup--code markup--p-code\">create<\/code>\u00a0and\u00a0<code class=\"markup--code markup--p-code\">start<\/code>\u00a0into one command:\u00a0<code class=\"markup--code markup--p-code\">run<\/code>.<\/p>\n<p id=\"a6a0\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container run my_image<\/strong><\/code><strong class=\"markup--strong markup--p-strong\">\u200a<\/strong>\u2014<strong class=\"markup--strong markup--p-strong\">\u200a<\/strong>Create a new container and start it. It also has\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/run\/#parent-command\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/run\/#parent-command\">a lot of options<\/a>. Let\u2019s look at a few.<\/p>\n<p id=\"7a12\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container run -i -t -p 1000:8000 --rm my_image<\/strong><\/code><\/p>\n<p id=\"484c\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-i<\/code>\u00a0is short for\u00a0<code class=\"markup--code markup--p-code\">--interactive<\/code>. Keep STDIN open even if unattached.<\/p>\n<p id=\"a379\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-t<\/code>is short for<code class=\"markup--code markup--p-code\">--tty<\/code>. Allocates a pseudo\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/en.wikipedia.org\/wiki\/Pseudo_terminal\" target=\"_blank\" rel=\"nofollow noreferrer noopener\" data-href=\"http:\/\/en.wikipedia.org\/wiki\/Pseudo_terminal\">terminal<\/a>\u00a0that connects your terminal with the container\u2019s STDIN and STDOUT.<\/p>\n<p id=\"00bc\" class=\"graf graf--p graf-after--p\">You need to specify both\u00a0<code class=\"markup--code markup--p-code\">-i<\/code>\u00a0and\u00a0<code class=\"markup--code markup--p-code\">-t<\/code>\u00a0to then interact with the container through your terminal shell.<\/p>\n<p id=\"7acf\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-p<\/code>\u00a0is short for\u00a0<code class=\"markup--code markup--p-code\">--port<\/code>. The port is the interface with the outside world.<code class=\"markup--code markup--p-code\">1000:8000<\/code>\u00a0maps the Docker port 8000 to port 1000 on your machine. If you had an app that output something to the browser you could then navigate your browser to\u00a0<code class=\"markup--code markup--p-code\">localhost:1000<\/code>\u00a0and see it.<\/p>\n<p id=\"a42d\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">--rm<\/code>\u00a0Automatically delete the container when it stops running.<\/p>\n<p id=\"0799\" class=\"graf graf--p graf-after--p\">Let\u2019s look at some more examples of\u00a0<code class=\"markup--code markup--p-code\">run<\/code>.<\/p>\n<p id=\"ebd6\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container run -it my_image my_command<\/strong><\/code><\/p>\n<p id=\"ad6c\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">sh<\/code>\u00a0is a command you could specify at run time.<code class=\"markup--code markup--p-code\">sh<\/code>\u00a0will start a shell session inside your container that you can interact with through your terminal.\u00a0<code class=\"markup--code markup--p-code\">sh<\/code>\u00a0is preferable to\u00a0<code class=\"markup--code markup--p-code\">bash<\/code>\u00a0for Alpine images because Alpine images don\u2019t come with\u00a0<code class=\"markup--code markup--p-code\">bash<\/code>\u00a0installed. Type\u00a0<code class=\"markup--code markup--p-code\">exit<\/code>\u00a0to end the interactive shell session.<\/p>\n<p id=\"76bd\" class=\"graf graf--p graf-after--p\">Notice that we combined\u00a0<code class=\"markup--code markup--p-code\">-i<\/code>\u00a0and\u00a0<code class=\"markup--code markup--p-code\">-t<\/code>\u00a0into\u00a0<code class=\"markup--code markup--p-code\">-it<\/code>.<\/p>\n<p id=\"8fb7\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container run -d my_image<\/strong><\/code><\/p>\n<p id=\"0fcf\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-d<\/code>\u00a0is short for\u00a0<code class=\"markup--code markup--p-code\">--detach<\/code>. Run the container in the background. Allows you to use the terminal for other commands while your container runs.<\/p>\n<h4 id=\"0082\" class=\"graf graf--h4 graf-after--p\">Checking Container Status<\/h4>\n<p id=\"2ec2\" class=\"graf graf--p graf-after--h4\">If you have running Docker containers and want to find out which one to interact with, then you need to list them.<\/p>\n<p id=\"2142\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container ls<\/strong><\/code>\u200a\u2014\u200aList running<em class=\"markup--em markup--p-em\">\u00a0<\/em>containers. Also provides useful information about the containers.<\/p>\n<p id=\"5fd2\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container ls -a -s<\/strong><\/code><\/p>\n<p id=\"cc63\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-a<\/code>\u00a0is short for\u00a0<code class=\"markup--code markup--p-code\">-all<\/code>. List all containers (not just running ones).<\/p>\n<p id=\"cc8e\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-s<\/code>\u00a0is short for\u00a0<code class=\"markup--code markup--p-code\">--size<\/code>. List the size for each container.<\/p>\n<p id=\"55fa\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container inspect my_container<\/strong><\/code>\u200a\u2014\u200aSee lots of info about a container.<\/p>\n<p id=\"2e0f\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container logs my_container<\/strong><\/code>\u200a\u2014\u200aPrint a container\u2019s logs.<\/p>\n<figure id=\"c8d8\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*icdqfkCNhA8mhJ82ctt54Q.jpeg\" data-width=\"640\" data-height=\"426\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"48\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*icdqfkCNhA8mhJ82ctt54Q.jpeg\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*icdqfkCNhA8mhJ82ctt54Q.jpeg\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Logs. Not sure how virtual logs are related. Maybe via reams of\u00a0paper?<\/figcaption><\/figure>\n<h4 id=\"323a\" class=\"graf graf--h4 graf-after--figure\">Container Endings<\/h4>\n<p id=\"f6da\" class=\"graf graf--p graf-after--h4\">Sometimes you need to stop a running container.<\/p>\n<p id=\"3699\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container stop my_container<\/strong><\/code>\u200a\u2014\u200aStop one or more running containers gracefully. Gives a default of 10 seconds before container shutdown to finish any processes.<\/p>\n<p id=\"3a1c\" class=\"graf graf--p graf-after--p\">Or if you are impatient:<\/p>\n<p id=\"7c7d\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container kill my_container<\/strong><\/code>\u200a\u2014\u200aStop one or more running containers abruptly. It\u2019s like pulling the plug on the TV. Prefer\u00a0<code class=\"markup--code markup--p-code\">stop<\/code>\u00a0in most situations.<\/p>\n<p id=\"e4fc\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code u-paddingRight0 u-marginRight0\">d<strong class=\"markup--strong markup--p-strong\">ocker container kill $(docker ps -q)<\/strong><\/code>\u200a\u2014\u200aKill all running containers.<\/p>\n<figure id=\"7654\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*z04O3uNyI_so53j0hqIjhg.jpeg\" data-width=\"640\" data-height=\"426\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"48\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*z04O3uNyI_so53j0hqIjhg.jpeg\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*z04O3uNyI_so53j0hqIjhg.jpeg\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">docker kill cockroach<\/figcaption><\/figure>\n<p id=\"a036\" class=\"graf graf--p graf-after--figure\">Then you delete the container with:<\/p>\n<p id=\"706a\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container rm my_container<\/strong><\/code>\u200a\u2014\u200aDelete one or more containers.<\/p>\n<p id=\"e472\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container rm $(docker ps -a -q)<\/strong><\/code>\u200a\u2014\u200aDelete all containers that are not running.<\/p>\n<p id=\"20e1\" class=\"graf graf--p graf-after--p\">Those are the eight essential commands for Docker containers.<\/p>\n<p id=\"e6c7\" class=\"graf graf--p graf-after--p\">To recap, you first create a container. Then, you start the container. Or combine those steps with\u00a0<code class=\"markup--code markup--p-code\">docker run my_container<\/code>. Then, your app runs. Yippee!<\/p>\n<p id=\"a07a\" class=\"graf graf--p graf-after--p\">Then, you stop a container with\u00a0<code class=\"markup--code markup--p-code\">docker stop my_container<\/code>. Eventually you delete the container with\u00a0<code class=\"markup--code markup--p-code\">docker rm my_container<\/code>.<\/p>\n<p id=\"8cfb\" class=\"graf graf--p graf-after--p\">Now, let\u2019s turn to the magical container-producing molds called images.<\/p>\n<h3 id=\"33fe\" class=\"graf graf--h3 graf-after--p\">Images<\/h3>\n<p id=\"d40b\" class=\"graf graf--p graf-after--h3\">Here are seven commands for working with Docker images.<\/p>\n<h4 id=\"6290\" class=\"graf graf--h4 graf-after--p\">Developing Images<\/h4>\n<p id=\"05ae\" class=\"graf graf--p graf-after--h4\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image build -t my_repo\/my_image:my_tag\u00a0.<\/strong><\/code>\u200a\u2014\u200aBuild a Docker image named\u00a0<em class=\"markup--em markup--p-em\">my_image<\/em>\u00a0from the Dockerfile located at the specified path or URL.<\/p>\n<p id=\"fe66\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-t<\/code>\u00a0is short for tag. Tells docker to tag the image with the provided tag. In this case\u00a0<em class=\"markup--em markup--p-em\">my_tag\u00a0.<\/em><\/p>\n<p id=\"29dc\" class=\"graf graf--p graf-after--p\">The\u00a0<code class=\"markup--code markup--p-code\">.<\/code>\u00a0(period) at the end of the command tells Docker to build the image according to the Dockerfile in the current working directory.<\/p>\n<figure id=\"0412\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*pzypY32qru9mOB-qOb4Evw.jpeg\" data-width=\"640\" data-height=\"425\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"48\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*pzypY32qru9mOB-qOb4Evw.jpeg\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*pzypY32qru9mOB-qOb4Evw.jpeg\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Build it<\/figcaption><\/figure>\n<p id=\"7c30\" class=\"graf graf--p graf-after--figure\">Once you have an image built you want to\u00a0<code class=\"markup--code markup--p-code\">push<\/code>\u00a0it to a remote registry so it can be shared and pulled down as needed. Assuming you want to use\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/hub.docker.com\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/hub.docker.com\/\">Docker Hub<\/a>, go there in your browser and create an account. It\u2019s free. \ud83d\ude04<\/p>\n<p id=\"2f3a\" class=\"graf graf--p graf-after--p\">This next command isn\u2019t an image command, but it\u2019s useful to see here, so I\u2019ll mention it.<\/p>\n<p id=\"e908\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker login<\/strong><\/code>\u200a\u2014\u200aLog in to a Docker registry. Enter your username and password when prompted.<\/p>\n<figure id=\"78b2\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*ZgMR-_PYuu3ghNyPzLHrGA.jpeg\" data-width=\"640\" data-height=\"428\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"50\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*ZgMR-_PYuu3ghNyPzLHrGA.jpeg\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*ZgMR-_PYuu3ghNyPzLHrGA.jpeg\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Push<\/figcaption><\/figure>\n<p id=\"834d\" class=\"graf graf--p graf-after--figure\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image push my_repo\/my_image:my_tag<\/strong><\/code>\u200a\u2014\u200aPush an image to a registry.<\/p>\n<p id=\"ae02\" class=\"graf graf--p graf-after--p\">Once you have some images you might want to inspect them.<\/p>\n<h4 id=\"dcae\" class=\"graf graf--h4 graf-after--p\">Inspecting Images<\/h4>\n<figure id=\"1ee1\" class=\"graf graf--figure graf-after--h4\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"aspectRatioPlaceholder-fill\"><\/div>\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*bldenADzHHFGZa8e3XVXUA.png\" data-width=\"640\" data-height=\"314\" data-scroll=\"native\"><canvas class=\"progressiveMedia-canvas js-progressiveMedia-canvas\" width=\"75\" height=\"36\"><\/canvas><img decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*bldenADzHHFGZa8e3XVXUA.png\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*bldenADzHHFGZa8e3XVXUA.png\" \/><\/div>\n<\/div><figcaption class=\"imageCaption\">Inspection time<\/figcaption><\/figure>\n<p id=\"241d\" class=\"graf graf--p graf-after--figure\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image ls<\/strong><\/code>\u200a\u2014\u200aList your images. Shows you the size of each image, too.<\/p>\n<p id=\"7cc8\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image history my_image<\/strong><\/code>\u200a\u2014\u200aDisplay an image\u2019s intermediate images with sizes and how they were created.<\/p>\n<p id=\"adb7\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image inspect my_image<\/strong><\/code>\u200a\u2014\u200aShow lots of details about your image, including the layers that make up the image.<\/p>\n<p id=\"be7d\" class=\"graf graf--p graf-after--p\">Sometimes you\u2019ll need to clean up your images.<\/p>\n<h4 id=\"269e\" class=\"graf graf--h4 graf-after--p\">Removing Images<\/h4>\n<p id=\"43fa\" class=\"graf graf--p graf-after--h4\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image rm my_image<\/strong><\/code>\u200a\u2014\u200aDelete the specified image. If the image is stored in a remote repository, the image will still be available there.<\/p>\n<p id=\"7e5e\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image rm $(docker images -a -q)<\/strong><\/code>\u200a\u2014\u200aDelete all images. Careful with this one! Note that images that have been pushed to a remote registry will be preserved\u200a\u2014\u200athat\u2019s one of the benefits of registries. \ud83d\ude03<\/p>\n<p id=\"5fb4\" class=\"graf graf--p graf-after--p\">Now you know most essential Docker image-related commands. We\u2019ll cover data-related commands in the next article.<\/p>\n<div class=\"postArticle-content js-postField js-notesSource js-trackPostScrolls\" data-post-id=\"970ea5203421\" data-source=\"post_page\" data-collection-id=\"7f60cf5620c9\" data-tracking-context=\"postPage\" data-scroll=\"native\">\n<section class=\"section section--body section--first section--last\">\n<div class=\"section-content\">\n<div class=\"section-inner sectionLayout--insetColumn\">\n<h3 id=\"5cee\" class=\"graf graf--h3 graf-after--figure\">Misc<\/h3>\n<p id=\"b1a3\" class=\"graf graf--p graf-after--h3\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker version<\/strong><\/code>\u200a\u2014\u200aList info about your Docker Client and Server versions.<\/p>\n<p id=\"7c0c\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker login<\/strong><\/code>\u2014 Log in to a Docker registry. Enter your username and password when prompted.<\/p>\n<p id=\"7f05\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker system prune<\/strong><\/code>\u00a0makes an appearance in the next article. Readers on\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/twitter.com\/Docker\/status\/1093233051906134016\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/twitter.com\/Docker\/status\/1093233051906134016\">Twitter<\/a>\u00a0and\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/www.reddit.com\/r\/docker\/comments\/anh1se\/15_docker_commands_you_should_know_part_5_of\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/www.reddit.com\/r\/docker\/comments\/anh1se\/15_docker_commands_you_should_know_part_5_of\/\">Reddit<\/a>\u00a0suggested that it would be good to add to this list. I agree, so I\u2019m adding it.<\/p>\n<p id=\"c1de\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker system prune<\/strong><\/code>\u00a0\u2014Delete all unused containers, unused networks, and dangling images.<\/p>\n<p id=\"3fa1\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker system prune -a --volumes<\/strong><\/code><\/p>\n<p id=\"f22d\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">-a<\/code>\u00a0is short for\u00a0<code class=\"markup--code markup--p-code\">--all<\/code>. Delete unused images,\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/stackoverflow.com\/a\/45143234\/4590385\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/stackoverflow.com\/a\/45143234\/4590385\">not just dangling ones<\/a>.<\/p>\n<p id=\"ddfe\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">--volumes<\/code>\u00a0Remove unused volumes. We\u2019ll talk more about volumes in the next article.<\/p>\n<h4 id=\"c44c\" class=\"graf graf--h4 graf-after--p\">UPDATE Feb. 7, 2019: Management Commands<\/h4>\n<p id=\"3809\" class=\"graf graf--p graf-after--h4\">In CLI 1.13 Docker introduced management command names that are logically grouped and consistently named. The old commands still work, but the new ones make it easier to get started with Docker. The original version of this article listed the old names. I\u2019ve updated the article to use the management command names based on reader suggestions. Note that this change only introduces two command name changes\u200a\u2014\u200ain most cases it just means adding\u00a0<code class=\"markup--code markup--p-code\">container<\/code>\u00a0or\u00a0<code class=\"markup--code markup--p-code\">image<\/code>\u00a0to the command. A mapping of the commands is\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"http:\/\/blog.arungupta.me\/docker-1-13-management-commands\/\" target=\"_blank\" rel=\"noopener\" data-href=\"http:\/\/blog.arungupta.me\/docker-1-13-management-commands\/\">here<\/a>.<\/p>\n<h3 id=\"ca9c\" class=\"graf graf--h3 graf-after--p\">Wrap<\/h3>\n<p id=\"4d6b\" class=\"graf graf--p graf-after--h3\">If you are just getting started with Docker, these are the three most important commands:<\/p>\n<p id=\"d0a2\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker container run my_image<\/strong><\/code>\u200a\u2014\u200aCreate a new container and start it. You\u2019ll probably want some flags here.<\/p>\n<p id=\"412f\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image build -t my_repo\/my_image:my_tag\u00a0.<\/strong><\/code>\u200a\u2014\u200aBuild an image.<\/p>\n<p id=\"80f6\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\"><strong class=\"markup--strong markup--p-strong\">docker image push my_repo\/my_image:my_tag<\/strong><\/code>\u200a\u2014\u200aPush an image to a remote registry.<\/p>\n<p id=\"5b7b\" class=\"graf graf--p graf-after--p\">Here\u2019s the larger list of essential Docker commands:<\/p>\n<h4 id=\"ae9d\" class=\"graf graf--h4 graf-after--p\">Containers<\/h4>\n<p id=\"6490\" class=\"graf graf--p graf-after--h4\">Use\u00a0<code class=\"markup--code markup--p-code\">docker container my_command<\/code><\/p>\n<p id=\"1901\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">create<\/code>\u200a\u2014\u200aCreate a container from an image.<br \/>\n<code class=\"markup--code markup--p-code\">start\u200a<\/code>\u2014\u200aStart an existing container.<br \/>\n<code class=\"markup--code markup--p-code\">run<\/code>\u200a\u2014\u200aCreate a new container and start it.<br \/>\n<code class=\"markup--code markup--p-code\">ls<\/code>\u200a\u2014\u200aList running<em class=\"markup--em markup--p-em\">\u00a0<\/em>containers.<br \/>\n<code class=\"markup--code markup--p-code\">inspect<\/code>\u200a\u2014\u200aSee lots of info about a container.<br \/>\n<code class=\"markup--code markup--p-code\">logs<\/code>\u200a\u2014\u200aPrint logs.<br \/>\n<code class=\"markup--code markup--p-code\">stop<\/code>\u200a\u2014\u200aGracefully stop running container.<br \/>\n<code class=\"markup--code markup--p-code\">kill<\/code>\u00a0\u2014Stop main process in container abruptly.<br \/>\n<code class=\"markup--code markup--p-code\">rm<\/code>\u2014 Delete a stopped container.<\/p>\n<h4 id=\"cdd7\" class=\"graf graf--h4 graf-after--p\">Images<\/h4>\n<p id=\"0f8f\" class=\"graf graf--p graf-after--h4\">Use\u00a0<code class=\"markup--code markup--p-code\">docker image my_command<\/code><\/p>\n<p id=\"1ae7\" class=\"graf graf--p graf-after--p\"><code class=\"markup--code markup--p-code\">build\u200a<\/code>\u2014\u200aBuild an image.<br \/>\n<code class=\"markup--code markup--p-code\">push<\/code>\u200a\u2014\u200aPush an image to a remote registry.<br \/>\n<code class=\"markup--code markup--p-code\">ls<\/code>\u200a\u2014\u200aList images.<br \/>\n<code class=\"markup--code markup--p-code\">history<\/code>\u200a\u2014\u200aSee intermediate image info.<br \/>\n<code class=\"markup--code markup--p-code\">inspect<\/code>\u200a\u2014\u200aSee lots of info about an image, including the layers.<br \/>\n<code class=\"markup--code markup--p-code\">rm<\/code>\u200a\u2014\u200aDelete an image.<\/p>\n<h4 id=\"611b\" class=\"graf graf--h4 graf-after--p\">Misc<\/h4>\n<p id=\"5d3a\" class=\"graf graf--p graf-after--h4\"><code class=\"markup--code markup--p-code\">docker version<\/code>\u200a\u2014\u200aList info about your Docker Client and Server versions.<br \/>\n<code class=\"markup--code markup--p-code\">docker login\u200a<\/code>\u2014\u200aLog in to a Docker registry.<br \/>\n<code class=\"markup--code markup--p-code\">docker system prune<\/code>\u200a\u2014\u200aDelete all unused containers, unused networks, and dangling images.<\/p>\n<p id=\"caef\" class=\"graf graf--p graf-after--p\">To view the CLI reference when using Docker just enter the command\u00a0<code class=\"markup--code markup--p-code\">docker<\/code>in the command line. You can see the Docker docs\u00a0<a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/cli\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/cli\/\">here<\/a>.<\/p>\n<p id=\"b670\" class=\"graf graf--p graf-after--p\">Now you can really build things with Docker! As my daughter might say in emoji: \ud83c\udf52 \ud83e\udd5d \ud83c\udf4a \ud83c\udf4b \ud83c\udf49 \ud83c\udf4f \ud83c\udf4e \ud83c\udf47. Which I think translates to \u201cCool!\u201d So go forth and play with Docker!<\/p>\n<p id=\"20a1\" class=\"graf graf--p graf-after--p\">If you missed the earlier articles in this series, check them out. Here\u2019s the first one:<\/p>\n<div id=\"5eb7\" class=\"graf graf--mixtapeEmbed graf-after--p\"><a class=\"markup--anchor markup--mixtapeEmbed-anchor\" title=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-b7ba70caeb4b\" href=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-b7ba70caeb4b\" data-href=\"https:\/\/towardsdatascience.com\/learn-enough-docker-to-be-useful-b7ba70caeb4b\"><strong class=\"markup--strong markup--mixtapeEmbed-strong\">Learn Enough Docker to be Useful<\/strong><br \/>\n<em class=\"markup--em markup--mixtapeEmbed-em\">Part 1: The Conceptual Landscape<\/em>towardsdatascience.com<\/a><\/div>\n<p id=\"cddc\" class=\"graf graf--p graf-after--mixtapeEmbed\">In the final article in this series we\u2019ll spice things up with a discussion of data in Docker. Follow me to make sure you don\u2019t miss it!<\/p>\n<p id=\"e5f7\" class=\"graf graf--p graf-after--p graf--trailing\">I hope you found this article helpful. If you did, please give it some love on your favorite social media channels. Docker on! \ud83d\udc4f<\/p>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<\/div>\n<\/div>\n<p><a href=\"https:\/\/www.linux.com\/learn\/15-docker-commands-you-should-know\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article we\u2019ll look at 15 Docker CLI commands you should know. If you haven\u2019t yet, check out the rest of this series on\u00a0Docker concepts,\u00a0the ecosystem,\u00a0Dockerfiles, and\u00a0keeping your images slim. In Part 6 we\u2019ll explore data with Docker. I\u2019ve got a series on Kubernetes in the works too, so follow me to make sure &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/02\/08\/15-docker-commands-you-should-know-linux-com\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;15 Docker Commands You Should Know | Linux.com&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9283","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=9283"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9283\/revisions"}],"predecessor-version":[{"id":9486,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/9283\/revisions\/9486"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=9283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=9283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=9283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}