Docker: Adding Apps to Base Ignition Image after RUN

New to Docker, so you will have to forgive me as I potentially embarrass my self with 'noob' questions.

Was doing some troubleshooting of a couple of Docker containers and noticed that the image (https://hub.docker.com/r/inductiveautomation/ignition) does not have much in the way of other apps installed on it. I need to do some network troubleshooting and noticed that the image does have utilities like "ping' installed. I tried to install a utility on a running instance of docker but I don't seem to have the right privilege's to run 'apt-get'. Am I missing something fundamental in my understanding as to why I can add some helpful troubleshooting utilities to the image OS? Perhaps I need a proper volume for these installs to work? .....Proper docker-compose.yml?

Thanks in advance for your help.

You're correct that the image isn't loaded up with a bunch of extra tools past the minimum needed to run Ignition. This is by-design in most Docker images to keep things as small as possible with as few dependencies as needed.

You have a few options:

  • Build your own derived images that add tools that you commonly need. Then all of your containers you launch from that image will have what you expect right away. Some more info on building derived Ignition images over here in my ignition-derived-example repo.
  • Install those tools into your running containers, but remember you'll have to exec into the container as root for that, i.e.
    # exec in as root and then run your `apt-get update`, etc
    docker exec -it -u root <container name> bash
    
  • If you're using Docker Desktop, there is a new-ish debug shell under which you can install your favorite tools and have them accessible from the context of a running container. More info on that here in a blog post and in the reference docs.

@kcollins1 Thanks very much for your response and information. Much appreciated. Great to hear from the Docker Guru :slight_smile:

1 Like