Docker Tutorial
Docker Tutorial
Creator: Amruta Ashish Pednekar
A tool to automate the deployment of the application in containers so that the application can work in different environments.
Installation on Ubuntu
Open terminal
Remove any docker file running
$ sudo apt-get remove docker docker-engine docker.io
Update system
sudo apt-get update
Install docker and its dependencies
sudo apt install docker.io
sudo snap install docker
docker — versions
Pull an image from docker hub
sudo docker run hello-world
Check the docker image
sudo docker images
Display all docker containers
sudo docker ps -a
Check for containers in running state
sudo docker ps
Installation on Windows
Download Docker desktop for windows
https://hub.docker.com/editions/community/docker-ce-desktop-windows/
Run downloaded .exe installer
Check below option
Install required Windows components for WSL 2
Add shortcut to desktop
Install
After installation , it will ask to restart
Open installed app Docker Desktop
Accept Terms
Open
After opening Docker, if you get above message
Click on to hyperlink
Download WSL2 from that hyperlink
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
Install
Restart
Docker Tutorial
Prerequisites :
Create an account on https://hub.docker.com/
Login to Docker Desktop
Docker container
Clone repository by running Git in container
docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
It pulls the image from repository
Build the image
It provides all the files and code your container needs
cd getting-started
docker build .
OR
docker build -t docker101tutorial .
Run the container
docker run -d -p 80:80 --name docker-tutorial docker101tutorial
Save and share this image on Docker hub
docker tag docker101tutorial amrutapednekar/docker101tutorial
docker push amrutapednekar/docker101tutorial
Docker Commands List
https://docs.docker.com/engine/reference/commandline/docker/
docker — - help
Docker container commands
docker container— - help
Docker Image commands
docker image — - help

Comments
Post a Comment