{"id":14085,"date":"2022-10-03T14:20:26","date_gmt":"2022-10-03T14:20:26","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=14085"},"modified":"2025-07-12T05:40:16","modified_gmt":"2025-07-12T05:40:16","slug":"docker-update-command-explained-with-examples","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-update-command-explained-with-examples\/","title":{"rendered":"Docker Tutorials: docker update command explained with examples"},"content":{"rendered":"\n<p>The <strong>docker update<\/strong> command <strong>dynamically updates container configuration<\/strong>. You can use this command to prevent containers from consuming too many resources such as CPU and memory from their Docker host. With a single command, you can place limits on a single container or on many.<\/p>\n\n\n\n<p><strong>Notes<\/strong><\/p>\n\n\n\n<p>With the exception of the &#8211;kernel-memory option, you can specify these options on a running or a stopped container. On kernel version older than 4.6, you can only update &#8211;kernel-memory on a stopped container or on a running container with kernel memory initialized.<\/p>\n\n\n\n<p>The docker update command dynamically updates container configuration. You can use this command to prevent containers from consuming too many resources such as CPU and memory from their Docker host. With a single command, you can place limits on a single container or on many.<\/p>\n\n\n\n<p><strong>Notes<\/strong><\/p>\n\n\n\n<p>With the exception of the &#8211;kernel-memory option, you can specify these options on a running or a stopped container. On kernel version older than 4.6, you can only update &#8211;kernel-memory on a stopped container or on a running container with kernel memory initialized.<\/p>\n\n\n\n<p><strong>You can use &#8220;docker container update&#8221; instead of &#8220;docker update&#8221; as well.<\/strong><\/p>\n\n\n\n<p><strong>Docker update command Example<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/196c4ca3bf25c7d07b42f7e876df24af.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"options\">Options<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><td>Name, shorthand<\/td><td>Default<\/td><td>Description<\/td><\/tr><\/thead><tbody><tr><td><code>--blkio-weight<\/code><\/td><td><\/td><td>Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)<\/td><\/tr><tr><td><code>--cpu-period<\/code><\/td><td><\/td><td>Limit CPU CFS (Completely Fair Scheduler) period<\/td><\/tr><tr><td><code>--cpu-quota<\/code><\/td><td><\/td><td>Limit CPU CFS (Completely Fair Scheduler) quota<\/td><\/tr><tr><td><code>--cpu-rt-period<\/code><\/td><td><\/td><td><a href=\"https:\/\/docs.docker.com\/engine\/api\/v1.25\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>API 1.25+<\/strong><\/a><br>Limit the CPU real-time period in microseconds<\/td><\/tr><tr><td><code>--cpu-rt-runtime<\/code><\/td><td><\/td><td><a href=\"https:\/\/docs.docker.com\/engine\/api\/v1.25\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>API 1.25+<\/strong><\/a><br>Limit the CPU real-time runtime in microseconds<\/td><\/tr><tr><td><code>--cpu-shares , -c<\/code><\/td><td><\/td><td>CPU shares (relative weight)<\/td><\/tr><tr><td><code>--cpus<\/code><\/td><td><\/td><td><a href=\"https:\/\/docs.docker.com\/engine\/api\/v1.29\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>API 1.29+<\/strong><\/a><br>Number of CPUs<\/td><\/tr><tr><td><code>--cpuset-cpus<\/code><\/td><td><\/td><td>CPUs in which to allow execution (0-3, 0,1)<\/td><\/tr><tr><td><code>--cpuset-mems<\/code><\/td><td><\/td><td>MEMs in which to allow execution (0-3, 0,1)<\/td><\/tr><tr><td><code>--kernel-memory<\/code><\/td><td><\/td><td>Kernel memory limit<\/td><\/tr><tr><td><code>--memory , -m<\/code><\/td><td><\/td><td>Memory limit<\/td><\/tr><tr><td><code>--memory-reservation<\/code><\/td><td><\/td><td>Memory soft limit<\/td><\/tr><tr><td><code>--memory-swap<\/code><\/td><td><\/td><td>Swap limit equal to memory plus swap: \u2018-1\u2019 to enable unlimited swap<\/td><\/tr><tr><td><code>--pids-limit<\/code><\/td><td><\/td><td><a href=\"https:\/\/docs.docker.com\/engine\/api\/v1.40\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>API 1.40+<\/strong><\/a><br>Tune container pids limit (set -1 for unlimited)<\/td><\/tr><tr><td><code>--restart<\/code><\/td><td><\/td><td>Restart policy to apply when a container exits<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Docker Tutorials Fundamental To Advanced-2021 Crash Course:- <a href=\"https:\/\/bit.ly\/3hOIbTB\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/bit.ly\/3hOIbTB<\/a><\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_93707\"><iframe loading=\"lazy\"  id=\"_ytid_31972\"  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_93707\"  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>The docker update command dynamically updates container configuration. You can use this command to prevent containers from consuming too many resources such as CPU and memory from their Docker host&#8230;. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862,1],"tags":[],"class_list":["post-14085","post","type-post","status-publish","format-standard","hentry","category-docker","category-sql"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14085","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=14085"}],"version-history":[{"count":6,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14085\/revisions"}],"predecessor-version":[{"id":31437,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/14085\/revisions\/31437"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=14085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=14085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=14085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}