Skip to content

Commit

Permalink
docker vs vm
Browse files Browse the repository at this point in the history
  • Loading branch information
Tikam02 committed Oct 26, 2019
1 parent 00b88bd commit ba635b6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Docker/docker-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,31 @@


- Containers Vs VM

- When talking about containerization it is very often compared to virtual machines. Let’s take a look at the following image to see the main difference :

- The Docker container platform is always running on top of the host operating system. Containers are containing the binaries, libraries, and the application itself. Containers do not contain a guest operating system which ensures that containers are lightweight.

-In contrast virtual machines are running on a hypervisor (responsible for running virtual machines) and include it’s own guest operating system. This increased the size of the virtual machines significantly, makes setting up virtual machines more complex and requires more resources to run each virtual machine.

![container vs VM]()

- Dockerfile

- Blueprint of a docker image (a text document) is known as Dockerfile. This file contains all the commands you would run in order to build the docker image you want. Docker can build images reading this file, which is one of the key advantages of docker.

```bash
# Super simple example of a Dockerfile
FROM ubuntu:latest
MAINTAINER Tikam Alma

RUN apt-get update
RUN apt-get install -y python python-pip wget
RUN pip install Flask

ADD hello.py /home/hello.py

WORKDIR /home
```

- We first write a Dockerfile which is like the definition of the image. Using the Dockerfile we create a docker image. We then push this image to Docker Hub and provide a unique tag that can be used to identify our image. Using this tag and image name, we can pull the docker image and deploy on another computer as a docker container.
Binary file added img/dockervsvm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/sharing-layers.jpg
Binary file not shown.

0 comments on commit ba635b6

Please sign in to comment.