{"id":5076,"date":"2018-07-10T12:46:22","date_gmt":"2018-07-10T12:46:22","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=5076"},"modified":"2021-02-27T09:07:02","modified_gmt":"2021-02-27T09:07:02","slug":"lifecycle-of-docker-containers","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/","title":{"rendered":"Lifecycle of Docker Containers"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5091\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers.png\" alt=\"\" width=\"600\" height=\"315\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers.png 600w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-300x158.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>We need to carefully understand the life cycle of Docker containes. There are following images which depicts the the right phases of docker containers.<\/p>\n<p><strong>Phase of Docker Containers<\/strong><\/p>\n<ul>\n<li>Create -&gt; Destroy<\/li>\n<li>Create -&gt; Start -&gt; Stopped -&gt; Destroy<\/li>\n<li>Create -&gt; Start -&gt; Pause -&gt; Unpause<\/li>\n<li>Create -&gt; Start -&gt; Restart<\/li>\n<\/ul>\n<p><strong>Image flow of Simple Docker Container Lifecycle<\/strong><\/p>\n<p><a href=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase-simple.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5077\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase-simple.jpg\" alt=\"\" width=\"638\" height=\"497\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase-simple.jpg 638w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase-simple-300x234.jpg 300w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><\/a><\/p>\n<p><strong>Image flow of Detailed Docker Container Lifecycle<\/strong><\/p>\n<p><a href=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5078\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase.png\" alt=\"\" width=\"1129\" height=\"575\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase.png 1129w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase-300x153.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase-768x391.png 768w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase-1024x522.png 1024w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers-lifecycle-phase-660x336.png 660w\" sizes=\"auto, (max-width: 1129px) 100vw, 1129px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Image Source and Credits: http:\/\/docker-saigon.github.io\/post\/Docker-Internals\/<\/p>\n<p><strong>Create container<\/strong><br \/>\n$ docker create &#8211;name ubuntu-cont ubuntu<\/p>\n<p><strong>Run docker container<\/strong><br \/>\n$ docker run -itd ubuntu<br \/>\n$ docker run -itd &#8211;name ubuntu-cont ubuntu<\/p>\n<p><strong>Pause container<\/strong><br \/>\n$ docker pause &lt;container-id\/name&gt;<\/p>\n<p><strong>Unpause container<\/strong><br \/>\n$ docker unpause &lt;container-id\/name&gt;<\/p>\n<p><strong>Start container<\/strong><br \/>\n$ docker start &lt;container-id\/name&gt;<\/p>\n<p><strong>Stop container<\/strong><br \/>\n$ docker stop &lt;container-id\/name&gt;<\/p>\n<p><strong>Restart container<\/strong><br \/>\n$ docker restart &lt;container-id\/name&gt;<\/p>\n<p><strong>Kill container<\/strong><br \/>\n$ docker kill &lt;container-id\/name&gt;<\/p>\n<p><strong>Destroy container<\/strong><br \/>\n$ docker rm &lt;container-id\/name&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We need to carefully understand the life cycle of Docker containes. There are following images which depicts the the right [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":5091,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[1194,567,4962,4961],"class_list":["post-5076","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-container","tag-docker","tag-docker-containers","tag-lifecycle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Lifecycle of Docker Containers - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lifecycle of Docker Containers - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"We need to carefully understand the life cycle of Docker containes. There are following images which depicts the the right [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-10T12:46:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:07:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"315\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Lifecycle of Docker Containers\",\"datePublished\":\"2018-07-10T12:46:22+00:00\",\"dateModified\":\"2021-02-27T09:07:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/\"},\"wordCount\":164,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/docker-containers.png\",\"keywords\":[\"Container\",\"Docker\",\"docker containers\",\"lifecycle\"],\"articleSection\":[\"Docker\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/\",\"name\":\"Lifecycle of Docker Containers - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/docker-containers.png\",\"datePublished\":\"2018-07-10T12:46:22+00:00\",\"dateModified\":\"2021-02-27T09:07:02+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/docker-containers.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/07\\\/docker-containers.png\",\"width\":600,\"height\":315},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/lifecycle-of-docker-containers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lifecycle of Docker Containers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Lifecycle of Docker Containers - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/","og_locale":"en_US","og_type":"article","og_title":"Lifecycle of Docker Containers - scmGalaxy","og_description":"We need to carefully understand the life cycle of Docker containes. There are following images which depicts the the right [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/","og_site_name":"scmGalaxy","article_published_time":"2018-07-10T12:46:22+00:00","article_modified_time":"2021-02-27T09:07:02+00:00","og_image":[{"width":600,"height":315,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers.png","type":"image\/png"}],"author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Lifecycle of Docker Containers","datePublished":"2018-07-10T12:46:22+00:00","dateModified":"2021-02-27T09:07:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/"},"wordCount":164,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers.png","keywords":["Container","Docker","docker containers","lifecycle"],"articleSection":["Docker"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/","name":"Lifecycle of Docker Containers - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers.png","datePublished":"2018-07-10T12:46:22+00:00","dateModified":"2021-02-27T09:07:02+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-containers.png","width":600,"height":315},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/lifecycle-of-docker-containers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Lifecycle of Docker Containers"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=5076"}],"version-history":[{"count":3,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5076\/revisions"}],"predecessor-version":[{"id":5093,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5076\/revisions\/5093"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/5091"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=5076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=5076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=5076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}