Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Default Operating System

I am looking at a docker file which does not specify a specific base image operating system (like FROM ubuntu: 14:04). Is there any specification on the default operating system used when building an image (and not specifying a base os-image)?

like image 470
Ueli Hofstetter Avatar asked Jan 05 '23 21:01

Ueli Hofstetter


2 Answers

You always should have a FROM instruction for a Dockerfile as per documentation as mentioned by Munir. However, you can choose variety of base images, which does not have to be an OS for your Dockerfile. For example, if you are creating a docker image for your java application, you can use java image as your base images.

FROM library/java

However, at the end, if you traverse thorough those image's Dockerfile, you will end up in one or the other OS. Java is based on Debian.

like image 76
techtabu Avatar answered Jan 08 '23 09:01

techtabu


according to the docker reference https://docs.docker.com/engine/reference/builder/

Docker runs the instructions in a Dockerfile in order. The first instruction must be FROM in order to specify the Base Image from which you are building.

like image 41
ABC Avatar answered Jan 08 '23 11:01

ABC