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

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

Popular posts from this blog

PERSONAL ACCESS TOKEN ON GITHUB

PostgreSQL Commands

Rails Application with Docker