What file does a docker container execute on startup?

tink asked:

I’m playing with foreman (learning about both foreman and docker), and wanted to try the docker approach.

Working with an official container from docker hub

Can’t find the docker file for it anywhere.

How do I find out which file gets executed when I fire up the container from within the container?

The reason that I’m asking is that I’d like the container to use both network interfaces of the host, one for the Web-UI, the other for dishing out DHCP and DNS on a separate private network.

If I execute the container with ‘bash’ tacked on I can pass my config options for dns and dhcp proxy network to it, but I lose all the other goodness, i.e. SSL certs, admin credentials, …

My answer:


You can run docker inspect to get this information. For example:

$ docker inspect --format="{{.Config.Cmd}}" ddf27d538154
/app/docker-entrypoint.sh

Run it without --format to see the complete JSON configuration for your container.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.