<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Docker on Notes by kirill.zak</title><link>https://kirill-zak.ru/en-us/posts/docker/</link><description>Recent content in Docker on Notes by kirill.zak</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sat, 19 Jul 2025 23:50:59 +0300</lastBuildDate><atom:link href="https://kirill-zak.ru/en-us/posts/docker/index.xml" rel="self" type="application/rss+xml"/><item><title>Docker Run Without Stop</title><link>https://kirill-zak.ru/en-us/posts/docker/docker-run-without-stop/</link><pubDate>Sat, 19 Jul 2025 23:50:59 +0300</pubDate><guid>https://kirill-zak.ru/en-us/posts/docker/docker-run-without-stop/</guid><description>&lt;h2 id="initial-data"&gt;Initial Data&lt;/h2&gt;
&lt;p&gt;Let’s imagine a situation: there is a Docker container that performs some operation and then finishes. Docker stops such a container after the operation is completed.&lt;/p&gt;
&lt;p&gt;The Dockerfile would look something like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-Dockerfile" data-lang="Dockerfile"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;alpine:latest&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;COPY&lt;/span&gt; some-cmd.sh some-cmd.sh&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;CMD&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;/some-cmd.sh&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;p&gt;Let’s consider a situation where it is necessary to enter the container after the operation is completed for debugging. How can we prevent Docker from stopping the container after the command running inside it is completed?&lt;/p&gt;</description></item></channel></rss>