How to handle installation of an interactive installer in Dockerfile

I was reading a few tutorials and the guidelines for creating a Dockerfile in docker docs. I know about keeping it simple, installing packages, etc…

I am not after the technical solution, I am trying to get the understanding on the approach to be used.

So here we are, say I am trying to create an image using a software which is not available as rpm, so no apt-get, no yum, etc… for that one. In fact one can install it this way: “curl -sSL | bash”.

For the sake of the exercice, I used the official docker image for Debian. It has no “curl”, so I had to apt-get it first.

I want to create that image using the Dockerfile. Here is a draft I am making:

FROM debian:8.4


RUN apt-get update && apt-get install -y curl _
_ dialog

CMD ["/bin/sh",""]

  1. How am I suppose to install that software pihole since the installer will then have some interactive steps? (It will show a text gui and one has to select 2, 3 options). I think option 1 would be to manually connect to the container, run the installer, etc… and then save the image. But I am trying to understand how to do it all using the Dockerfile, or how it fits with the Dockerfile.

  2. In the exemple above, I have to get both curl and dialog otherwise the installer will not run.

  3. I am not sure what I am supposed to run in the CMD, since I think most important steps are done in the RUN. Once I will run the container, created from that image, it is supposed to have nothing to do but works.

  4. Maybe my logic is flawed, maybe there is an official docker image for pihole, and one is supposed to use it as a start, instead of trying to create it. As I said it’s an understanding exercice!

Can you please help me shed some lights on the questions above?


could check out what they did:

I registered on gitter and asking the author directly.
I still don’t understand the logic though. I understand the concepts of Phoenix deployments. For now and to me, this docker version appears to highly complexify a simple software. For exemple, to upgrade on the “traditional version” (pi-hole installed on raspbian), it’s only required to do “pihole -up”. While here, it’s requesting to destroy eveything entirely and recreate the entire image, and re-run the container. Also, it makes one dependant to the image authors as opposed to the pi-hole authors (which I think are more reactive with updates).

To come back to my initial understanding efforts, regarding the Dockerfile, how one would manage installing something requiring an interactive shell?