Please correct me if I’m wrong. Up to my understanding, advantage of containers is that those don’t need to supply the whole OS and they also don’t need to execute it (but instead they utilize underlying OS which is provided e.g. by Docker) which leads to the saving of the resources -especially the memory.
My question is: do I need to pay attention when choosing base image for my containers that I plan to deploy in Azure k8s service (AKS) which currently supports Ubuntu 18.04? Should I choose only from those base images that explicitly support Ubuntu 18.04 or can I go for any base Linux image (e.g. Alpine) and all will still work fine once deployed in AKS?
I guess that as far as my base image is compliant (same Linux kernel version) with the Linux kernel available in AKS then I should be fine. Is my assumption correct?
3
Answers
Short answer: you can pick any base image that’s compatible with whatever is running inside your container.
More precisely, containers do not run their own OS kernel. They do run their own copy of the part of the OS that runs in user space.
Practically speaking, kernel version compatibility is rarely a concern.
Be aware of DNS resolution issues with alpine based images.
Lookup musl/alpine/dns/aks/eks for example.
I don’t know if I understand correctly, but the main advantage of containers is that they isolate the processes running in them – between themselves and the operating system.
Possible problems within the container should not affect other containers and the base system.
As for memory efficiency, running several containers on one machine doesn’t require as many resources as running each ‘application’ on a separate VM in a separate case.