{"id":8865,"date":"2022-04-08T14:37:10","date_gmt":"2022-04-08T19:37:10","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8865"},"modified":"2022-04-21T14:39:36","modified_gmt":"2022-04-21T19:39:36","slug":"docker-changing-an-existing-container","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8865","title":{"rendered":"Docker &#8211; Changing an Existing Container"},"content":{"rendered":"<p>I&#8217;ll start by acknowledging that, of course, you could just redeploy the container with the settings you want now. The whole point of containerized development is that anything &#8220;good&#8221; should either be part of the deployment settings or data persisted outside of the container. So, in theory, redeploying the container every day shouldn&#8217;t really be detectable. Even when you didn&#8217;t deploy the original container (i.e. you don&#8217;t have the Dockerfile or docker run command handy to tweak as needed), you can reverse engineer what you need from docker inspect. But sometimes? It&#8217;s quicker\/easier\/more convenient to just fix what you need to within the existing container. And it is possible to do so.<\/p>\n<p>The trickiest part is finding the right file to edit.<\/p>\n<p># cd into docker container definition folder<br \/>\ncd \/var\/lib\/docker\/containers\/<br \/>\n# find the guid for the container you want to edit<br \/>\ndocker ps<br \/>\n# Find the corresponding folder name<br \/>\nls -al | grep bc9dc66882af<br \/>\n# cd into that folder<br \/>\ncd bc9dc66882af18f59c209faf10031fe21765571d0a2fe4a32a768a1d52cc1e53<br \/>\n# Edit the config.v2.json file for the container<br \/>\nvi config.v2.json<br \/>\n# And, finally, restart docker<br \/>\nsystemctl stop docker<br \/>\nsystemctl start docker<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/?attachment_id=8866\" rel=\"attachment wp-att-8866\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8866\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/04\/Docker-FindContainerFolder.png\" alt=\"\" width=\"1145\" height=\"211\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/04\/Docker-FindContainerFolder.png 1145w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/04\/Docker-FindContainerFolder-300x55.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/04\/Docker-FindContainerFolder-1024x189.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/04\/Docker-FindContainerFolder-768x142.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/04\/Docker-FindContainerFolder-750x138.png 750w\" sizes=\"auto, (max-width: 1145px) 100vw, 1145px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ll start by acknowledging that, of course, you could just redeploy the container with the settings you want now. The whole point of containerized development is that anything &#8220;good&#8221; should either be part of the deployment settings or data persisted outside of the container. So, in theory, redeploying the container every day shouldn&#8217;t really be &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[623],"tags":[231],"class_list":["post-8865","post","type-post","status-publish","format-standard","hentry","category-containerized-development-and-deployment","tag-docker"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8865"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8865\/revisions"}],"predecessor-version":[{"id":8867,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8865\/revisions\/8867"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}