{"id":5080,"date":"2022-10-03T14:27:03","date_gmt":"2022-10-03T14:27:03","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=5080"},"modified":"2025-07-12T05:40:15","modified_gmt":"2025-07-12T05:40:15","slug":"docker-pause-and-unpause-explanined","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-pause-and-unpause-explanined\/","title":{"rendered":"Docker Tutorials: docker pause and unpause explanined!"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5089\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/07\/docker-1.png\" alt=\"\" width=\"600\" height=\"315\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/07\/docker-1.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/07\/docker-1-300x158.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>As of Version 0.12.0, Docker supports PAUSE and UNPAUSE commands to pause and resume containers using cgroup freezer.<\/p>\n<p>The docker pause command suspends all processes in the specified containers. On Linux, this uses the cgroups freezer. Traditionally, when suspending a process the SIGSTOP signal is used, which is observable by the process being suspended. With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. On Windows, only Hyper-V containers can be paused.<\/p>\n<p>So it means that the processes in the container stop running, and they are able to be resumed later.<\/p>\n<p>Possible use is to pause resource intensive tasks that you can resume at a later date. Some people predict that \u201cdocker pause\u201d could be used in the future to support \u201clive\u201d migration of containers between Docker Engines.<\/p>\n<p>Checkout more about cgroups freezer here https:\/\/www.kernel.org\/doc\/Documentation\/cgroup-v1\/freezer-subsystem.txt<\/p>\n<p>[code]<br>\n[root@ip-172-31-80-30 ~]# docker run -d -p 8080:8080 -p 50000:50000 jenkins<\/p>\n<p>[root@ip-172-31-80-30 ~]# docker ps<br>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br>\n6be033bf1f69 jenkins &#8220;\/bin\/tini &#8212; \/usr\/l\u2026&#8221; About an hour ago Up About an hour (Paused) 0.0.0.0:8080-&gt;8080\/tcp, 0.0.0.0:50000-&gt;50000\/tcp laughing_bell<\/p>\n<p>[root@ip-172-31-80-30 ~]# docker pause 6be033bf1f69<br>\nError response from daemon: Container 6be033bf1f6917f3bfcccd5d770c00349c47576ab1cd77b14aa39ef1333ae90c is already paused<\/p>\n<p>[root@ip-172-31-80-30 ~]# docker ps<br>\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br>\n6be033bf1f69 jenkins &#8220;\/bin\/tini &#8212; \/usr\/l\u2026&#8221; About an hour ago Up About an hour (Paused) 0.0.0.0:8080-&gt;8080\/tcp, 0.0.0.0:50000-&gt;50000\/tcp laughing_bell<\/p>\n<p>[root@ip-172-31-80-30 ~]# docker exec -it 6be033bf1f69 \/bin\/bash<br>\nError response from daemon: Container 6be033bf1f69 is paused, unpause the container before exec<\/p>\n<p>[root@ip-172-31-80-30 ~]# docker top 6be033bf1f69<br>\nUID PID PPID C STIME TTY TIME CMD<br>\nec2-user 23703 23691 0 13:26 ? 00:00:00 \/bin\/tini &#8212; \/usr\/local\/bin\/jenkins.sh<br>\nec2-user 23724 23703 0 13:26 ? 00:00:23 java -jar \/usr\/share\/jenkins\/jenkins.war<\/p>\n<p>[\/code]<\/p>\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_29591\"><iframe loading=\"lazy\"  id=\"_ytid_22392\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_29591\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>As of Version 0.12.0, Docker supports PAUSE and UNPAUSE commands to pause and resume containers using cgroup freezer. The docker pause command suspends all processes in the specified containers. On&#8230; <\/p>\n","protected":false},"author":1,"featured_media":5089,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[567,4963,4965,4964,4966],"class_list":["post-5080","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-docker","tag-docker-pause","tag-docker-unpause","tag-pause","tag-unpause"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=5080"}],"version-history":[{"count":5,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5080\/revisions"}],"predecessor-version":[{"id":31448,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5080\/revisions\/31448"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/5089"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=5080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=5080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=5080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}