In this comprehensive Docker tutorial, you'll learn everything you need to know to get started with Docker. Starting from the basics, we'll explain what Docker is and why it's used in modern software development. You'll understand the concepts of containerization and how Docker simplifies the process of packaging, distributing, and running applications.
We'll explore Docker Hub, the official repository for Docker images, and show you how to pull and run images from Docker Hub. You'll also learn about Docker Compose, a tool for defining and running multi-container Docker applications.
One of the key aspects of Docker is the ability to containerize your own projects. We'll walk you through creating a Dockerfile for your application, configuring it to build your project into a Docker image, and then running it as a container. Additionally, you'll learn how to use volumes to persist data between container runs, ensuring your data is safe and accessible.
🔔 Don't forget to Like, Share, and Subscribe for more tutorials!
👉 Timestamps:
0:00 - Introduction
0:30 - What is docker
1:20 - Install docker
1:50 - Docker hub
2:26 - Pull and run docker image
3:15 - Configure container
6:33 - Connect to Database
9:02 - Docker Compose
11:29 Dockerfile (dockerise your project)
14:45 - complete docker setup
Follow me on:
Twitter: / ishaans54694584
LinkedIn: / ishaansharma7
Instagram: / ishaansharma711
Handy Docker Commands
1. create and run docker image
sudo docker run hello-world
2. see runing containers
docker ps
3. see images on system
docker images
4. pull image
docker pull redis
-------------------------------
1. run docker in attached mode
docker run
2. run container in detached mode
docker run -d redis
3. stop container
docker stop container_id
4. see all running and stoped containers
docker ps -a
5. restart docker image
docker start container_id
6. host port mapping ,first port of host, second of image
docker run -p6000:6379 -d redis
7. interactive terminal
sudo docker exec -it redis_latest1 /bin/bash
8. docker run vs docker compose, in compose we don't require to create network for services to talk to each other
9. see docker network
docker network ls
10. docker compose command to start
sudo docker-compose -f mongo.yaml up -d
11. build image using Dockerfile, my-app is name and version-1 is version
docker build -t my-app:version-1 .
12. delete container
docker rm container_id
13. delete image
docker rmi image_id