DOCKER
WHAT IS DOCKER?
Docker is a software platform that simplifies the process of building, running, managing, and distributing
applications using containers.
Developed by Docker Inc.
Docker is an open source.
Docker virtualizes the host OS (containers use the same kernel).
We can run container in seconds instead of minutes.
Docker allows for running applications in containers (isolated environments).
Docker is a tool or technology that helps you move your Application from one environment to another.
DOCKER EDITIONS
COMMUNITY EDITION
DOCKER ARCHITECTURE
BASIC DOCKER COMMANDS
docker image pull <image_name>
Downloads the specified image from Docker HUB to the local host
docker container create <image_name>
Creates a container from the specified image
docker container start <container_name>
Starts the specified container
docker container stop <container_name>
Stops the specified container
BASIC DOCKER COMMANDS
docker run <image_name>
Downloads the image, creates and runs a container from that image.
Docker = dockerd
Docker Docker
looks for the NO searches
Is it on Docker
docker run image on the Available? Docker Hub
Hub?
local for the
computer. image. Yes
The image
Docker layers are Docker creates a new container The
downloads installed on from the image and starts the container is
the image. the local program. running!
computer.
BASIC DOCKER COMMANDS
docker run -it fedora /bin/bash
-i: interact
-t or --tty: tells Docker to use a terminal.
docker run -d centos
-d: detach
Run container in the background
docker run -d centos sleep 20
Run container and sleep after 20 second
docker exec -it <container_id> bash
Logs in to the specified container
docker rm <container_name>
Removes a container
BASIC DOCKER COMMANDS
docker rmi <image_name>
Removes an image
docker images
Lists the docker images
docker ps
Lists the running containers (default)
docker ps -a
Lists all the running and stopping containers.
docker rm Syntax:
➢ docker rm
docker rmi → This command is used to delete an image from local storage
docker commit Syntax:
➢ docker commit docker
push Syntax:
➢ docker push