简体   繁体   中英

“From ubuntu” in docker container

I am very new to Docker and confused with some things first of which is

 FROM ubuntu:14.04
    RUN apt-get update
    RUN apt-get install -y curl nginx

above statement , does this statement mean we are installing ubuntu OS in a docker container which is already running on a OS eg DC/OS in my case.

It seems you have a misunderstanding of the docker concept.

What you are doing is pulling an image with the operating system of Ubuntu 14 and creating an instance of it (a container) that has nginx installed on it.

This does not make your os change it gives you a workspace not unlike a vm to run what you want.

The statment FROM ubuntu:14.04 means use the ubuntu image as a base image. The ubuntu image is not an OS. This image "mimics" an Ubuntu OS, in the sense that it has a very similar filesystem structure to an Ubuntu os and has many tools available that are typically found on Ubuntu.

The main and fundamental difference is that the Docker Ubuntu image does not have it own linux kernel. It uses the kernel of the host machine where the container is running.

Moreover, the size difference between the Docker image (73MB) and an Ubuntu iso(around 1Gb) is very significant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM