{"id":1592,"date":"2022-11-21T12:59:18","date_gmt":"2022-11-20T23:59:18","guid":{"rendered":"https:\/\/www.ronella.xyz\/?p=1592"},"modified":"2022-11-21T12:59:18","modified_gmt":"2022-11-20T23:59:18","slug":"basic-docker-container-management","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=1592","title":{"rendered":"Basic Docker Container Management"},"content":{"rendered":"<h2>Run Command<\/h2>\n<p>Run a command in a new container<\/p>\n<p>Display the help information using the following command:<\/p>\n<pre><code>docker container run --help<\/code><\/pre>\n<p>Example of creating a container for the <strong>swaggerapi\/swagger-editor<\/strong> image with the name <strong>swagger-editor<\/strong>.<\/p>\n<pre><code>docker container run -it -p 80:8080 --name swagger-editor swaggerapi\/swagger-editor<\/code><\/pre>\n<blockquote>\n<p>Since the <strong>-it options<\/strong> were used, you can stop the container using CTRL+C.<\/p>\n<p>Access the swagger-editor using the following address:<\/p>\n<p><a href=\"http:\/\/localhost\">http:\/\/localhost<\/a><\/p>\n<\/blockquote>\n<p><strong>This command can only be used for creating a container based on an image.<\/strong> Once the container was created you can start it using the <strong>start command<\/strong>. If you are not sure about the name of the container find it using the <strong>list command<\/strong>. <\/p>\n<p>It is better to have a <strong>name for the container<\/strong> so that you know what to start <em>(or stop or delete)<\/em>.<\/p>\n<h2>List Command<\/h2>\n<p>List containers.<\/p>\n<p>Display the help information using the following command:<\/p>\n<pre><code>docker container ls --help<\/code><\/pre>\n<p>Example of displaying all the containers.<\/p>\n<pre><code>docker container ls --all<\/code><\/pre>\n<h2>Start Command<\/h2>\n<p>Start one or more stopped containers<\/p>\n<p>Display the help information using the following command:<\/p>\n<pre><code>docker container start --help<\/code><\/pre>\n<p>Example of starting the container created from the run command section.<\/p>\n<pre><code>docker container start swagger-editor<\/code><\/pre>\n<h2>Stop Command<\/h2>\n<p>Stop one or more running containers<\/p>\n<p>Display the help information using the following command:<\/p>\n<pre><code>docker container stop --help<\/code><\/pre>\n<p>Example of stopping the container created from the run command section.<\/p>\n<pre><code>docker container stop swagger-editor<\/code><\/pre>\n<h2>Delete Command<\/h2>\n<p>Remove one or more containers<\/p>\n<p>Display the help information using the following command:<\/p>\n<pre><code>docker container rm --help<\/code><\/pre>\n<p>Example of deleting the container created from the run command section.<\/p>\n<pre><code>docker container rm swagger-editor<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Run Command Run a command in a new container Display the help information using the following command: docker container run &#8211;help Example of creating a container for the swaggerapi\/swagger-editor image with the name swagger-editor. docker container run -it -p 80:8080 &#8211;name swagger-editor swaggerapi\/swagger-editor Since the -it options were used, you can stop the container using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[78],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1592"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1592"}],"version-history":[{"count":1,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1592\/revisions"}],"predecessor-version":[{"id":1593,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1592\/revisions\/1593"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}