Docker Tip #4: Does Your Docker Image OS Need to Match Your Host OS?
Your Docker Image OS is what you have defined in your Dockerfile and your host OS is what you're running Docker on. They can be different.
I’ve seen a lot of people ask the question “If my Docker host is running Ubuntu does that mean my Docker images need to be based on Ubuntu too?”.
The answer to that is no way. You can use whatever base image you want for your Docker images.
In fact, most “official” Docker images are based on the Alpine distribution of Linux. It’s completely fine to use that along with an Ubuntu, Debian, CentOS, RHEL or whatever other distro you prefer on your Docker host (aka. the machine running Docker).