Docker
What is Docker ?
Docker is the world’s leading software container platform Docker makes the process of application deployment very easy and efficient and resolves a lot of issues related to deploying applications Docker is a tool designed to make it easier to deploy and run applications by using containers Docker gives you a standard way of packaging your application with all its dependencies in a container Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.
Understand a general workflow of docker
Difference between virtualization and containerization
Understand docker client server architecture
Understand:
Docker file
Docker images
Docker Containers
Docker Hub / Registry
Docker client
Docker server / daemon
Docker engine
Benefits of using Docker
Build app only once
No worries that the application will not perform the same way it did on testing environment
Portability
Version Control
Isolation
Productivity
Docker simplifies DevOps
Prerequisite
OS should be 64 bit
Linux kernel ver 3.10 or greater
command to check :
uname -r
STEP 1 - Connect to Linux system
STEP 2 - Install DOCKER
sudo yum -y update
sudo yum install -y docker
Docker
docker --version
STEP 3 - start DOCKER
sudo service docker start
sudo usermod -a -G docker "user"
docker info docker run hello-world : to run hello-world image
docker images : to get list of images present locally
docker ps : to get list of running containers
docker ps -a . : to get list of all containers
STEP 4 - stop DOCKER
sudo service docker stop
uninstall DOCKER
sudo yum remove docker
Docker Basic Commands
Step by Step for Beginners
Basic :
docker version
: docker -v
: docker info :
docker --help
: docker login
————————————
Images
: docker images
: docker pull
: docker rmi
————————————
Containers
: docker ps
: docker run
: docker start
: docker stop
————————————
System
: docker stats
: docker system df
: docker system prune
References :
https://docs.docker.com/engine/refere...
Dangling Images
A dangling image is one that is not tagged and is not referenced by any container.
Today we will learn :
1. What are images
2. How to pull image
3. How to run a container using an image
4. Basic Commands
TIPS & TRICKS
What are Images
Docker Images are templates used to create Docker containers
Container is a running instance of image
Where are Images Stored Registries (e.g. docker hub)
Can be stored locally or remote
: docker images --help
: docker pull image
: docker images
: docker images -q
: docker images -f “dangling=false”
: docker images -f “dangling=false” -q
: docker run image
: docker rmi image
: docker rmi -f image
: docker inspect
: docker history imageName
References:
https://hub.docker.com/_/ubuntu/
https://docs.docker.com/engine/refere...
Today we will learn :
1. What are Containers
2. How to create Containers
3. How to start / stop Containers
4. Basic Commands
TIPS & TRICKS
What are Containers:
Containers are running instances of Docker Images
COMMANDS
: docker ps
: docker run ImageName
: docker start ContainerName/ID
: docker stop ContainerName/ID
: docker pause ContainerName/ID
: docker unpause ContainerName/ID
: docker top ContainerName/ID
: docker stats ContainerName/ID
: docker attach ContainerName/ID
: docker kill ContainerName/ID
: docker rm ContainerName/ID
: docker history ImageName/ID
References:
https://www.google.co.in/search?rlz=1...
https://docs.docker.com/engine/refere...
A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it:
code, runtime, system tools, system libraries, settings.
Features of Containers:
Are lightweight
Fewer resources are used
Booting of containers is very fast
Can start, stop, kill, remove containers easily and quickly
Operating System resources can be shared within Docker
Containers run on the same machine sharing the same Operating system Kernel, this makes it faster
You can use the command
docker container create
to create a container in stopped state