Docker Intro
What is Docker?
Docker is a computer program that performs operating-system-level virtualization, also known as “containerization”.
After playing with it a couple days ago, some of the important points are:
- Docker is one of application that enables “containerization”. Other containerization application: Linux Containers
- Docker is primarily developed for Linux environment. It use resource relocation feature in Linux Kernel. Wikipedia
- To use docker in Windows, we need to run a Linux VM on Windows.
- On windows 7, we will need to use Docker Toolbox
- The docker toolbox includes Oracle VirtualBox to run the VM.
- On newer windows machine like Windows 10, we do not need Oracle VirtualBox.
Running Docker on Windows 7
- Download and install Docker Toolbox
- Run Docker Quickstart Terminal
- From what I’ve observed, Docker Quickstart Terminal will search and turn on the VM on Oracle Virtual Box
- If the VM is not exists, it will search for
boot2docker.iso
inside%userprofile%.docker\machine\cache
Use Kinematic if you want to use GUI to control Docker
Docker Hello World
To test if the docker configured properly, lets start with a Docker’s Hello World. Execute below command in terminal:
docker run hello-world
In simple terms, when the command executed:
- Docker client ask docker daemon to search for
docker image
with namehello-world
in local repository or public repository of docker image. - Docker daemon create a new container from
docker image
that found - Docker execute
command
that specified on thedocker image
, which is to print the message
DockerFile, DockerImage, Container Relationship
Everything starts with the
Dockerfile
. TheDockerfile
is the source code of the Image.Once the
Dockerfile
is created, we build it to create theimage
of the container (DockerImage
). Theimage
is just the “compiled version” of the “source code” which is theDockerfile
.Next, we can use the image to run containers. A running container is very similar, in many aspects, to a virtual machine (but it is not a virtual machine).
Good resource to start:
https://www.youtube.com/watch?v=YFl2mCHdv24