Docker Introduction
What is Docker?
Docker is an open platform for developing, shipping, and running applications. Docker
enables you to separate your applications from your infrastructure so you can deliver
software quickly. With Docker, you can manage your infrastructure in the same ways you
manage your applications. By taking advantage of Docker's methodologies for shipping,
testing, and deploying code, you can significantly reduce the delay between writing code and
running it in production.
java .apk Apps store download install
jar Pack and make
java (runtime Docker Hub
environment) image
Running in
Download
container
Docker v.s. Virtual Machine
Docker v.s. Virtual Machine
Virtual Machine Docker
Each VM runs its own OS All container share the same kernel of the host
Boot up time is in minutes Containers instantiate in seconds
Images are built incrementally on top of another
VMs snapshots are used sparingly
like layers. Lots of images/snapshots.
Images can be diffed and can be version
Not effective diffs. Not version controlled
controlled. Docker hub is like App store.
Cannot run more that couple of VMs on an
Can run many Docker containers in a laptop.
average laptop
Only one VM can be started from one set of Multiple Docker containers can be started from
VMX and VMDK files one Docker image.
Docker Architecture
Docker Client: The starting point of Docker
Provides a way for users to interact with Docker.
Docker Daemon: Taskmaster on the scene!
Runs on the host machine and handles all requests from the
Docker client, such as building, running, and distributing Docker
containers.
Docker Image: Your application’s blueprint.
Docker Images are read-only templates that form the basis of
containers.
Docker Container: Running instances of Docker
images.
A Docker container holds everything needed to run an application
— the code, runtime, libraries, environment variables, and
configuration files.
Docker Registry: Like a library for Docker Images!
The Docker registry is where Docker images live. Docker Hub is a
public registry that anyone can use, but you also have the option of
creating your own private registry. https://medium.com/@saddy.devs/understanding-docker-architecture-934ecd042b5f
How does Docker work?
Container 1 Container 2 Container i Container n
Server-end
Docker Daemon
Client-end Client 1 Client 2 Client j Client n
Host Computer
How does Docker run a new container from image “HelloWorld”?
uses this image
and runs it.
Docker first checks whether the downloads the
Start searches for the image is available image to the local
image locally environment.
locally.
Y
N
downloads the checks whether it’s
image from available on Docker
Docker Hub. Hub
N
If the image is not
found, it returns an
error.
Common Docker Commands (necessary to learn)
Basic Commands
docker version # Show the Docker version information
docker info # Display system-wide information
Image Commands
docker images # List images, show all top level images, their repository and tags, and their size.
docker search # Search Docker Hub for images
docker pull # Download an image from a registry
docker rmi # Remove one or more images
Container Commands
docker run # Create and run a new container from an image
docker ps # List containers
docker rm # Remove one or more containers
Other Commands
docker logs [OPTIONS] # print logs
docker top [container-ID] # View process information in the container
docker inspect [container-ID] # View container metadata
docker exec -it [container-ID] # Access the currently running container (open a new terminal)
docker attach [container-ID] # Access the currently running container (access the running terminal)
docker cp [container-ID]:[container-path] [target-host-path] # copy file from container to target host
https://hub.docker.com
Docker Resource: Docker Hub
https://docs.docker.com
Docker Resource: Official Documents
THANK YOU!