title: Is it possible to start a process using RUN command in Dockerfile?
body: <p>Currently I have a dockerfile that runs two executables using an ampersand:</p>
  <pre><code>FROM &lt;Linux base image&gt;
  CMD [&quot;bin/sh&quot;, &quot;-c&quot;, &quot;/service1 &amp; /service2&quot;]
  </code></pre>
  <p>As I am looking to migrate this dockerfile to distroless, I will no longer be able to run this ampersand command, since my new minimal image will no longer have a shell to recognize it. Thus I am looking for alternate ways to ensure I can run both services from the same image.</p>
  <p>As an alternative, I am experimenting with doing something like this:</p>
  <pre><code>FROM &lt;minimal base image&gt;
  RUN /service1
  CMD [&quot;/service2&quot;]
  </code></pre>
  <p>Is there any issue with executing /service1 using the RUN command? Is this even possible, given /service1 will be a process running on the container?</p>
  <p>Note: I am aware it is not usually recommended to run two services from the same container, but this is to help me better understand RUN and CMD commands. I have read through <a href="https://docs.docker.com/engine/reference/builder/" rel="nofollow noreferrer">Dockerfile reference</a> but it is still unclear to me. I have also tested this out locally and the container fails to run, although I do not see logs to confirm this is the reason.</p>