Git Product home page Git Product logo

docker_tutorial's Introduction

Docker_Tutorial

This repo has content about Docker

Create virtual environment using below command:

Adding virtual env : python -m venv ./venv
Actiavting virtual env : .\venv\Scripts\Activate.ps1

Command to build docker image

docker build -t welcome-app .

Check docker images

docker images

Run the docker images - Hostname mapping

docker run -p 5000:5000 welcome-app

Two IPs:

http://172.0.0.1:5000 -- It is wrt localhost and it will run normally
http://172.17.0.2:5000 -- It will not run initially. It is the IP present in the ocntainer. We can access it through our host container thorugh specific port

Command to check how many container is running

docker ps

Command to stop the container

docker stop "container_id"

Steps for docker hub deployment: Command to docker login

docker login
  • Then provide username and password

Command to rename the docker app name: 1st way: Command to remove docker image

docker image rm -f welcome-app

Command to build again

docker build -t hitterdixit/welcome-app .

2nd way: Command to change the docker image name

docker tag hitterdixit/welcome-app hitterdixit/welcome-app1
  • Naming convetion for docker hub should be username/docker_image_name Command to push to docker hub repository
docker push hitterdixit/welcome-app:latest
  • After that we can also download the image and run it as a container Command to pull docker image from dockerhub
docker pull hitterdixit/welcome-app:latest

Docker compose:

It is a tool to run and define multi-conatainer docker application

docker-compose.yml file: It is used to tun multi-container docker application

EXPOSE variable: It is used to specifiy port number that will be exposed to container

docker_tutorial's People

Contributors

subhashdixit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.