skip to Main Content

Docker images are often available with different base OS images.
I am not going to install other applications in that container. I will have separate container for each application I need.

Does it matter which base image I choose? If not why would I choose a larger image instead of a smaller one? What would I be giving away?

For example, Kong image is available in two variants with very different sizes:

CentOS based – 143.23 MB

Alpine based – 42.71 MB

https://hub.docker.com/_/kong?tab=tags

BTW, I am going to run the docker on Ubuntu.

2

Answers


  1. As mentioned in the comment it totally depends upon your need, but in the mentioned two images I will go for alpine.

    Does it matter which base image I choose?

    Yes its matter, there are a different reason to choose smaller one, some advantage may be

    • Smaller in size (build, pull, push is fast)
    • Take little space as the compared large image
    • Consume less MEMORY by the OS itself as compared to CentOS
    • Alpine is considered secure and fast
    • Alpine is an offical image for docker registry

    You can read the experimental base article here.

    SMALL

    Alpine Linux is built around musl libc and busybox. This makes it
    smaller and more resource efficient than traditional GNU/Linux
    distributions. A container requires no more than 8 MB and a
    minimal installation to disk requires around 130 MB of storage.
    Not only do you get a fully-fledged Linux environment but a large
    selection of packages from the repository.

    Binary packages are thinned out and split, giving you even more
    control over what you install, which in turn keeps your environment as
    small and efficient as possible.

    alpinelinux

    Login or Signup to reply.
  2. If you’re only going to run the image as-is, as I assume from

    I am not going to install other applications in that container. I will have separate container for each application I need.

    then it doesn’t matter (unless the image’s developer notes it does, of course!).

    If you’re going to use one of those images as a base image, then it does matter some – as noted here in comments and answers, the different distributions these images are based on have different tools and capabilities (Ubuntu/Debian has apt for a package manager, Alpine uses musl libc and has apk).

    At that point, you’ll want to choose a base image that has the tooling you’re comfortable with and supports the changes you’ll be enacting on top of the base image.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search