Giter Club home page Giter Club logo

docker's Introduction

Docker version command

docker --version

Docker Login

docker login -u USER_NAME DOCKER_REPO_URL -p PASSWORD

Docker tag image

docker tag image_name:ver tag_name:ver

Docker pull image

docker pull imageurl

Build Docker image

docker build -t my_image .

list out docker images

docker images

Run docker image

docker run -d -p 8080:8080 my_image

List out docker running processes

docker ps

Enter into docker file system

docker exec -t -i CONTAINER_ID bash or docker exec -ti cc55da85b915 /bin/sh or docker exec -ti cc55da85b915 ls /etc

How to stop docker process

docker stop CONTAINER_ID

Copy file from docker filesystem to host file system

docker cp <containerId>:/file/path/within/container /host/path/target

Delete docker image

docker rmi -f image_id

View docker logs

docker logs processid

Pass env variable to docker container

docker run -e var_name1="xxx" -e var_name2="35" -t my_image:2.0.0

Pass env list to docker container

docker run --env-file myimage.env my_image:0.0.2

Mount a host system folder

docker run -v D:/myHostFolder/apps:/dockerFolder/log -t my-image-2:0.0

Copy logs from docker container to host file system

docker logs continerid >logs.log

List out docker process id

docker ps -aq

Stop all Processes

docker stop $(docker ps -aq)

Remove all processes

docker rm $(docker ps -aq)

Removing all images

docker rmi $(docker images -q)

See the memory usage and cpu usage

docker stats

Limit resouces on docker container

docker run -d --cpus="1.0" --memory="100m" -t my-image-2:0.0

To Send logs to log stash

docker run --log-driver=syslog --log-opt syslog-address=tcp://<logstash-system-ip(use ip not localhost)>:5000 my-image:2.0.0

How to save docker image in tar file (docker save command) (Transfer docker image from one host to another)

docker save IMAGE_NAME:VERSON > MY_IMAGE.tar
or
docker save -o MY_IMAGE.tar IMAGE_NAME:VERSON

Store docker tar file into docker

docker load -i path_to_tar_file

Docker build in no cache mode

docker build  --no-cache 

docker's People

Contributors

ankitpatwa92 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.