Docker Community Forums

Share and learn in the Docker community.

Is OS needed inside a container?


(I4quest) #1

Hello Experts,
Appreciate if someone could clarify this.
If I understand it correctly, containers share OS from the server and that it doesn’t need OS installed in it unlike VM.
But , I’ve seen some dockerfiles with statements like “FROM ubuntu” and I"m confused with this. Why do we need to install OS in a container when it can share the server’s OS?
Thanks


(Stephen Steiner) #2

The container is managed by the host OS kernel, it does not share the actual OS. You don’t “install” an OS, it’s inherited from the base image (FROM alpine:3.6, for example), so you will see ALL Dockerfiles with a FROM statement.

Here’s some basic reading: https://docs.docker.com/get-started/#images-and-containers