{"id":2319,"date":"2021-03-10T20:36:16","date_gmt":"2021-03-10T18:36:16","guid":{"rendered":"https:\/\/www.virtono.com\/community\/?p=2319"},"modified":"2021-03-14T18:32:09","modified_gmt":"2021-03-14T16:32:09","slug":"overview-of-docker-commands-part-1","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/","title":{"rendered":"Overview of Docker Commands Part &#8211; 1"},"content":{"rendered":"\n<p>I suggest you get machine to follow along this part. So here&#8217;s a little plug of our own: <a href=\"https:\/\/www.virtono.com\/cloud-vps\" class=\"rank-math-link\">Cloud VPS, for as little as \u20ac2.95 a month.<\/a><\/p>\n\n\n\n<p>This article is a part of our complete series of articles on Docker. Click here to access the <a href=\"https:\/\/www.virtono.com\/community\/news-announcements\/docker-deep-dive---virtono\/\" class=\"rank-math-link\">Free Series<\/a>.<\/p>\n\n\n\n<p>Back to the article now&#8230;<\/p>\n\n\n\n<p>We have to use \u201cdocker\u201d on the CLI to run commands pertaining to docker.<\/p>\n\n\n\n<p>The best way to get started is to use \u201cdocker &#8211;help\u201d , you will immediately be bombarded with all the commands you can run using docker.<\/p>\n\n\n\n<p>It can feel over whelming at first, but not to sweat by the end of these tutorials you will be familiar with a lot of them and on your way to deep dive even further.<\/p>\n\n\n\n<p>At the end of this you can see: docker COMMAND &#8211;help<\/p>\n\n\n\n<p>This command in particular will help us understand other commands.<\/p>\n\n\n\n<p>Let\u2019s say we wanted to understand more about \u201cdocker image\u201d, we will run \u201cdocker image &#8211;help\u201d<\/p>\n\n\n\n<p>You will see this output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"263\" data-attachment-id=\"2344\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/1-1-4\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/1-1.png?fit=602%2C263&amp;ssl=1\" data-orig-size=\"602,263\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"1-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/1-1.png?fit=602%2C263&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/1-1.png?resize=602%2C263&#038;ssl=1\" alt=\"\" class=\"wp-image-2344\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/1-1.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/1-1.png?resize=300%2C131&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>Basics of working with Images and Containers<\/p>\n\n\n\n<p>Now we will download and work with an image for postgres database.<\/p>\n\n\n\n<p><strong>Checking if we have the required image:<\/strong><\/p>\n\n\n\n<p>When you ran the docker command \u201cdocker image &#8211;help\u201d, you should\u2019ve seen the ls command.<\/p>\n\n\n\n<p>So lets use it and check if we have a postgres image with us.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"56\" data-attachment-id=\"2343\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/2-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/2-1.png?fit=602%2C56&amp;ssl=1\" data-orig-size=\"602,56\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"2-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/2-1.png?fit=602%2C56&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/2-1.png?resize=602%2C56&#038;ssl=1\" alt=\"\" class=\"wp-image-2343\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/2-1.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/2-1.png?resize=300%2C28&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>This is what your output must be looking like, if you have followed the previous article for Docker Installation.<\/p>\n\n\n\n<p>However we do not see the postgres image.<\/p>\n\n\n\n<p><strong>Pulling the required Image:<\/strong><\/p>\n\n\n\n<p>Since we are trying to install postgres, this is the command you will run:<\/p>\n\n\n\n<p>docker image pull postgres<\/p>\n\n\n\n<p>General Command : docker image pull &lt; REQUIRED IMAGE NAME&gt;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"371\" data-attachment-id=\"2345\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/postgres-pull\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/postgres-pull.gif?fit=1901%2C942&amp;ssl=1\" data-orig-size=\"1901,942\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"postgres-pull\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/postgres-pull.gif?fit=750%2C371&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/postgres-pull.gif?resize=750%2C371&#038;ssl=1\" alt=\"\" class=\"wp-image-2345\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/postgres-pull.gif?resize=1024%2C507&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/postgres-pull.gif?resize=300%2C149&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/postgres-pull.gif?resize=768%2C381&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/postgres-pull.gif?resize=1536%2C761&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>If you are thinking that the image is being is pulled out of thin air, well first, congratulations for not loosing your innocence and sense of wonder. Secondly, please go through the Docker Architecture article to understand the workings.<\/p>\n\n\n\n<p>Lets check if the image is now in our system:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"82\" data-attachment-id=\"2342\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/3-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/3-1.png?fit=602%2C82&amp;ssl=1\" data-orig-size=\"602,82\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"3-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/3-1.png?fit=602%2C82&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/3-1.png?resize=602%2C82&#038;ssl=1\" alt=\"\" class=\"wp-image-2342\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/3-1.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/3-1.png?resize=300%2C41&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p><strong>Gathering more information related to the image:<\/strong><\/p>\n\n\n\n<p>So you just downloaded an image, and you ofcourse need to understand more about it before running it.<\/p>\n\n\n\n<p>For this purpose we have the inspect command:<\/p>\n\n\n\n<p>docker image inspect &lt;IMAGE ID&gt;<\/p>\n\n\n\n<p>Note: Image ID is available by running docker image ls, like previous step.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"46\" data-attachment-id=\"2341\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/4-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/4-1.png?fit=602%2C46&amp;ssl=1\" data-orig-size=\"602,46\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"4-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/4-1.png?fit=602%2C46&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/4-1.png?resize=602%2C46&#038;ssl=1\" alt=\"\" class=\"wp-image-2341\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/4-1.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/4-1.png?resize=300%2C23&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>You will be greeted with a \u201cNovel\u201d about the image in json format.<\/p>\n\n\n\n<p>Not everything is important, only pay attention to the main characters for now.<\/p>\n\n\n\n<p>Environment Variable that are defined are present as \u201cEnv\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"26\" data-attachment-id=\"2340\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/5-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/5-1.png?fit=602%2C26&amp;ssl=1\" data-orig-size=\"602,26\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"5-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/5-1.png?fit=602%2C26&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/5-1.png?resize=602%2C26&#038;ssl=1\" alt=\"\" class=\"wp-image-2340\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/5-1.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/5-1.png?resize=300%2C13&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>Command that is performed when we start the container<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"376\" height=\"152\" data-attachment-id=\"2337\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/6-2-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/6-2.png?fit=376%2C152&amp;ssl=1\" data-orig-size=\"376,152\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"6-2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/6-2.png?fit=376%2C152&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/6-2.png?resize=376%2C152&#038;ssl=1\" alt=\"\" class=\"wp-image-2337\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/6-2.png?w=376&amp;ssl=1 376w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/6-2.png?resize=300%2C121&amp;ssl=1 300w\" sizes=\"auto, (max-width: 376px) 100vw, 376px\" \/><\/figure>\n\n\n\n<p>In the Config section you can find the info like Exposed Port where you can find the service provided by this image.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"381\" height=\"250\" data-attachment-id=\"2339\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/11-8\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/11.png?fit=381%2C250&amp;ssl=1\" data-orig-size=\"381,250\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"11\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/11.png?fit=381%2C250&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/11.png?resize=381%2C250&#038;ssl=1\" alt=\"\" class=\"wp-image-2339\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/11.png?w=381&amp;ssl=1 381w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/11.png?resize=300%2C197&amp;ssl=1 300w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><\/figure>\n\n\n\n<p>In this case Postgres will be running on 5432 port.<\/p>\n\n\n\n<p><strong>Starting a Container from Image<\/strong><\/p>\n\n\n\n<p>Now that we have our image on our box, let us create a container out of it.<\/p>\n\n\n\n<p>Starting a container requires you to use the run command.<\/p>\n\n\n\n<p>Running the command with \u201c&#8211;help\u201d will fetch you the Options that you can use.<\/p>\n\n\n\n<p>For now let\u2019s try to run the container by using the run command:<\/p>\n\n\n\n<p>docker container run postgres<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"137\" data-attachment-id=\"2335\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/7-1-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/7-1.png?fit=602%2C137&amp;ssl=1\" data-orig-size=\"602,137\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"7-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/7-1.png?fit=602%2C137&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/7-1.png?resize=602%2C137&#038;ssl=1\" alt=\"\" class=\"wp-image-2335\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/7-1.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/7-1.png?resize=300%2C68&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>We get an error.<\/p>\n\n\n\n<p>Now this error is specific to postgres, as we are trying to run a database service, we need to specify a password for the superuser, trust all connections.<\/p>\n\n\n\n<p>So lets give a password:<\/p>\n\n\n\n<p>docker&nbsp; container run -e POSTGRES_PASSWORD=postgres postgres <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"288\" data-attachment-id=\"2334\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/8-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/8-1.png?fit=602%2C288&amp;ssl=1\" data-orig-size=\"602,288\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"8-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/8-1.png?fit=602%2C288&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/8-1.png?resize=602%2C288&#038;ssl=1\" alt=\"\" class=\"wp-image-2334\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/8-1.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/8-1.png?resize=300%2C144&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p><strong>Exiting Containers<\/strong><\/p>\n\n\n\n<p>Press \u2018Ctrl+C\u2019 to exit the container, you will see this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"20\" data-attachment-id=\"2333\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/9-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/9-1.png?fit=602%2C20&amp;ssl=1\" data-orig-size=\"602,20\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"9-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/9-1.png?fit=602%2C20&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/9-1.png?resize=602%2C20&#038;ssl=1\" alt=\"\" class=\"wp-image-2333\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/9-1.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/9-1.png?resize=300%2C10&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>Doing a \u201cdocker container ls -a\u201d, you will notice that the container is&nbsp; in exited state.<\/p>\n\n\n\n<p>So how do we run a container and not let it hinder our usual process, or run a container in the background?<\/p>\n\n\n\n<p>If you had noticed the \u201cdocker container run\u201d command has an option \u201c-d\u201d this runs a detached container.<\/p>\n\n\n\n<p>So lets try that:<\/p>\n\n\n\n<p>docker&nbsp; container run -e POSTGRES_PASSWORD=postgres -d postgres<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"54\" data-attachment-id=\"2332\" data-permalink=\"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-1\/attachment\/10-3-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/10-3.png?fit=602%2C54&amp;ssl=1\" data-orig-size=\"602,54\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"10-3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/10-3.png?fit=602%2C54&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/10-3.png?resize=602%2C54&#038;ssl=1\" alt=\"\" class=\"wp-image-2332\" srcset=\"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/10-3.png?w=602&amp;ssl=1 602w, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/10-3.png?resize=300%2C27&amp;ssl=1 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p>Voila!<\/p>\n\n\n\n<p>Now you have a container running in the background!<\/p>\n\n\n\n<p>But the fun doesn\u2019t end here, we will now discuss, how to access a container in the next tutorial!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I suggest you get machine to follow along this part. So here&#8217;s a little plug of our own: Cloud VPS, for as little as \u20ac2.95 a month. This article is a part of our complete series of articles on Docker. Click here to access the Free Series. Back to the<\/p>\n","protected":false},"author":4,"featured_media":2346,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,3],"tags":[],"class_list":["post-2319","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase","category-tutorial-how-to"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/1_HS1OsFO7ayf_ZUzPus1FCQ.jpeg?fit=1280%2C720&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-Bp","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":3626,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-configure-a-private-docker-registry-in-ubuntu-22-04\/","url_meta":{"origin":2319,"position":0},"title":"How to Configure a Private Docker Registry in Ubuntu 22.04","author":"George B.","date":"June 26, 2023","format":false,"excerpt":"There are situations where you might want to set up your own private Docker registry even though Docker Hub offers a public registry for storing and sharing Docker images. In this guide, we'll show you how to set up a private Docker registry on Ubuntu 22.04 so you can manage\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Configure-a-Private-Docker-Registry-in-Ubuntu-22-04.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Configure-a-Private-Docker-Registry-in-Ubuntu-22-04.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Configure-a-Private-Docker-Registry-in-Ubuntu-22-04.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2349,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/overview-of-docker-commands-part-2\/","url_meta":{"origin":2319,"position":1},"title":"Overview of Docker Commands Part &#8211; 2","author":"Shreyash Sharma","date":"March 17, 2021","format":false,"excerpt":"In the previous tutorial, we went through the steps to get a container up and running. We used Postgres as an example. This section of the tutorial series will continue to build on that. In this section we will learn how to interact with the container, how to execute commands\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/docker-commands-1200x385-1.jpg?fit=1200%2C385&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/docker-commands-1200x385-1.jpg?fit=1200%2C385&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/docker-commands-1200x385-1.jpg?fit=1200%2C385&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/docker-commands-1200x385-1.jpg?fit=1200%2C385&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/docker-commands-1200x385-1.jpg?fit=1200%2C385&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":3221,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/remove-docker-containers-images-and-volumes\/","url_meta":{"origin":2319,"position":2},"title":"Remove Docker Containers, Images, and Volumes","author":"George B.","date":"April 11, 2023","format":false,"excerpt":"Docker provides a comprehensive set of command-line tools that enable you to clean up your system effectively. If you are a beginner with Docker, this article can serve as a useful cheat sheet for reference. It provides step-by-step guidance on how to delete various objects such as Images, Containers, Volumes,\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Plesk-on-Almalinux-and-Rocky-1.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Plesk-on-Almalinux-and-Rocky-1.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/How-to-Install-Plesk-on-Almalinux-and-Rocky-1.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3619,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-wordpress-using-docker-compose\/","url_meta":{"origin":2319,"position":3},"title":"How to Install WordPress using Docker Compose","author":"George B.","date":"June 25, 2023","format":false,"excerpt":"We will walk you through the process of installing WordPress using Docker Compose, allowing you to run your WordPress blog efficiently and effortlessly. WordPress is a popular content management system (CMS) that is used by millions of websites worldwide. Docker Compose, on the other hand, is a powerful tool for\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-WordPress-using-Docker-Compose.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-WordPress-using-Docker-Compose.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-Install-WordPress-using-Docker-Compose.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3954,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-and-configure-docker-swarm-on-ubuntu-22-04\/","url_meta":{"origin":2319,"position":4},"title":"How to Install and Configure Docker Swarm on Ubuntu 22.04","author":"George B.","date":"September 27, 2023","format":false,"excerpt":"This tutorial will show you how to install and configure Docker Swarm on Ubuntu 22.04 ensuring that you harness its full potential for your containerized applications. For effectively scaling and managing containers, Docker Swarm is still a great option. Many developers and DevOps experts prefer it because of its ease\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/09\/How-to-Install-and-Configure-Docker-Swarm-on-Ubuntu.png?fit=360%2C240&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2287,"url":"https:\/\/www.virtono.com\/community\/knowledgebase\/docker-architecture-and-components\/","url_meta":{"origin":2319,"position":5},"title":"Docker Architecture and Components","author":"Shreyash Sharma","date":"March 7, 2021","format":false,"excerpt":"If you want to get hands-on real-world experience with understanding and deploying Docker Containers. Or if you have an idea and want to see it containerized online, I suggest you get a Cloud VPS, for as little as \u20ac2.95 a month. This article is a part of our complete series\u2026","rel":"","context":"In &quot;Knowledgebase&quot;","block_context":{"text":"Knowledgebase","link":"https:\/\/www.virtono.com\/community\/category\/knowledgebase\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/DOCK02.png?fit=558%2C254&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/DOCK02.png?fit=558%2C254&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2021\/03\/DOCK02.png?fit=558%2C254&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/2319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=2319"}],"version-history":[{"count":2,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/2319\/revisions"}],"predecessor-version":[{"id":2350,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/2319\/revisions\/2350"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/2346"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=2319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=2319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=2319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}