Git Product home page Git Product logo

docker's Introduction

Docker

docker is a tool designed to make it easier to create deploy and run applications by using containers.

To install docker in linux

sudo yum install docker -y

to start the docker

sudo systemctl start docker

to check docker is install or not

docker --version

to login to dockerhub account

docker login give the login credentials and password

to list of images

docker images

to build a images from a dockerfile

docker build -t name (t indicates the tag)

to pull the image from the docker hub:

docker pull imagename

to run the container out of the image

docker run -it --name name of the container -p port number image name

example imagename is nginx and container name is c1 need to run on specific port 8000

docker run -it --name c1 -p 8000:8000 nginx (-it indicates run in a interactive mode) you can use -d for detached mode.

to check the list of running containers

docker ps

to check the list of all the containers.

docker ps -a

to remove the images

docker rmi imagename

to remove the container

docker rm containername / id

to stop the running container

docker stop containername/id

Dockerfile essential commands

FROM ENV RUN ENTRYPOINT ADD WORKDIR EXPOSE USER VOLUME

to push the image to your own dockerhub account

first you need to tag the image

docker tag name orginalimage name

for ex: i need to make ubuntu offical in my own name you can tag by giving your name

docker tag ubuntu balaubuntu

after the tag the image is created on your own name

to push

docker push balaubuntu.

to get a image from the running container.

docker commit conatinername newimagename ex: conatiner is c8 and image is nginx:v2 docker commit c8 nginx:v2

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.