Follow

Follow

Docker Administration Series - Docker Commands

Puja Das's photo
Puja Das
ยทAug 12, 2022ยท

2 min read

Docker Administration Series -
                               Docker Commands

Table of contents

๐‡๐š๐ฏ๐ž ๐ฒ๐จ๐ฎ ๐œ๐ก๐ž๐œ๐ค๐ž๐ ๐จ๐ฎ๐ญ ๐Œ๐ฒ ๐ง๐ž๐ฐ ๐ƒ๐จ๐œ๐ค๐ž๐ซ ๐’๐ž๐ซ๐ข๐ž๐ฌ?? ๐Ÿค”๐Ÿค”

๐ƒ๐Ž๐‚๐Š๐„๐‘ ๐‚๐Ž๐Œ๐Œ๐€๐๐ƒ๐’ ...

๐Ÿ“Œ๐…๐จ๐ซ ๐œ๐ก๐ž๐œ๐ค๐ข๐ง๐  ๐ƒ๐จ๐œ๐ค๐ž๐ซ ๐•๐ž๐ซ๐ฌ๐ข๐จ๐ง..

    docker --version

๐Ÿ“Œ๐“๐จ ๐œ๐ก๐ž๐œ๐ค ๐ญ๐ก๐ž ๐œ๐จ๐ฆ๐ฉ๐ฅ๐ž๐ญ๐ž ๐ข๐ง๐Ÿ๐จ๐ซ๐ฆ๐š๐ญ๐ข๐จ๐ง ๐š๐›๐จ๐ฎ๐ญ ๐ƒ๐จ๐œ๐ค๐ž๐ซ ๐‡๐จ๐ฌ๐ญ..

    docker info

๐Ÿ“Œ๐“๐จ ๐ข๐๐ž๐ง๐ญ๐ข๐Ÿ๐ฒ ๐ญ๐ก๐ž ๐จ๐Ÿ๐Ÿ๐ข๐œ๐ข๐š๐ฅ ๐ข๐ฆ๐š๐ ๐ž๐ฌ ๐Ÿ๐ซ๐จ๐ฆ ๐ญ๐ก๐ž ๐ƒ๐จ๐œ๐ค๐ž๐ซ ๐‡๐ฎ๐›..

    docker search <image name>

๐Ÿ“Œ๐“๐จ ๐ซ๐ฎ๐ง ๐ญ๐ก๐ž ๐ข๐ฆ๐š๐ ๐ž..

    docker run <image name>

๐Ÿ“Œ๐“๐จ ๐œ๐ก๐ž๐œ๐ค ๐ญ๐ก๐ž ๐„๐ฑ๐ข๐ญ๐ž๐ ๐‚๐จ๐ง๐ญ๐š๐ข๐ง๐ž๐ซ ๐ฌ๐ญ๐š๐ญ๐ž..

    docker ps -a

๐Ÿ“Œ๐“๐จ ๐œ๐ก๐ž๐œ๐ค ๐ญ๐ก๐ž ๐‘๐ฎ๐ง๐ง๐ข๐ง๐  ๐‚๐จ๐ง๐ญ๐š๐ข๐ง๐ž๐ซ ๐ฌ๐ญ๐š๐ญ๐ž..

    docker ps

๐Ÿ“Œ๐“๐จ ๐ฅ๐จ๐ ๐ ๐ž๐ ๐ข๐ง ๐ข๐ง๐ญ๐จ ๐ญ๐ก๐ž ๐‚๐จ๐ง๐ญ๐š๐ข๐ง๐ž๐ซ..

    docker run -it <image name> bash

๐Ÿ“Œ๐“๐จ ๐ซ๐ฎ๐ง ๐š๐ฌ ๐š ๐๐š๐œ๐ค๐ ๐ซ๐จ๐ฎ๐ง๐ ๐ฉ๐ซ๐จ๐œ๐ž๐ฌ๐ฌ..

    docker run -dit <image name>  (-d:Detached Mode)

๐Ÿ“Œ๐“๐จ ๐œ๐ซ๐ž๐š๐ญ๐ž ๐š ๐ง๐ž๐ฐ ๐ฉ๐ซ๐จ๐œ๐ž๐ฌ๐ฌ ๐จ๐Ÿ ๐š ๐‚๐จ๐ง๐ญ๐š๐ข๐ง๐ž๐ซ..

    docker exec -it <container-id> bash

๐Ÿ“Œ๐“๐จ ๐จ๐ง๐ฅ๐ฒ ๐๐จ๐ฐ๐ง๐ฅ๐จ๐š๐ ๐ญ๐ก๐ž ๐ข๐ฆ๐š๐ ๐ž ๐Ÿ๐ซ๐จ๐ฆ ๐ƒ๐จ๐œ๐ค๐ž๐ซ ๐‡๐ฎ๐›..

    docker pull <image name>

๐Ÿ“Œ๐“๐จ ๐œ๐ก๐ž๐œ๐ค ๐ญ๐ก๐ž ๐ข๐ฆ๐š๐ ๐ž๐ฌ ๐ข๐ง๐ฌ๐ข๐๐ž ๐จ๐ฎ๐ซ ๐Œ๐š๐œ๐ก๐ข๐ง๐ž..

    docker images

๐Ÿ“Œ๐“๐จ ๐œ๐ก๐ž๐œ๐ค ๐œ๐จ๐ฆ๐ฉ๐ฅ๐ž๐ญ๐ž ๐ข๐ง๐Ÿ๐จ๐ซ๐ฆ๐š๐ญ๐ข๐จ๐ง ๐š๐›๐จ๐ฎ๐ญ ๐จ๐ง๐ž ๐ฉ๐š๐ซ๐ญ๐ข๐œ๐ฎ๐ฅ๐š๐ซ ๐ข๐ฆ๐š๐ ๐ž..

    docker image inspect <image name>

๐Ÿ“Œ๐“๐จ ๐ซ๐ž๐ฆ๐จ๐ฏ๐ž ๐š๐ฅ๐ฅ ๐„๐ฑ๐ข๐ญ๐ž๐ ๐‚๐จ๐ง๐ญ๐š๐ข๐ง๐ž๐ซ..

   docker system prune

๐Ÿ“Œ๐“๐จ ๐ฌ๐ž๐ญ ๐ญ๐ก๐ž ๐ง๐š๐ฆ๐ž ๐จ๐Ÿ ๐ญ๐ก๐ž ๐ƒ๐จ๐œ๐ค๐ž๐ซ ๐‚๐จ๐ง๐ญ๐š๐ข๐ง๐ž๐ซ..

    docker run -d --name (random name) <image name>

๐Ÿ“Œ๐“๐จ ๐œ๐ก๐ž๐œ๐ค ๐œ๐จ๐ฆ๐ฉ๐ฅ๐ž๐ญ๐ž ๐ข๐ง๐Ÿ๐จ๐ซ๐ฆ๐š๐ญ๐ข๐จ๐ง ๐š๐›๐จ๐ฎ๐ญ ๐จ๐ง๐ž ๐ฉ๐š๐ซ๐ญ๐ข๐œ๐ฎ๐ฅ๐š๐ซ ๐‚๐จ๐ง๐ญ๐š๐ข๐ง๐ž๐ซ(๐ข๐ญ ๐ฌ๐ก๐จ๐ฎ๐ฅ๐ ๐›๐ž ๐ข๐ง ๐ซ๐ฎ๐ง๐ง๐ข๐ง๐  ๐ฌ๐ญ๐š๐ญ๐ž)..

    docker container inspect <container-id>

๐Ÿ“Œ๐“๐จ ๐š๐ญ๐ญ๐š๐œ๐ก ๐ฉ๐จ๐ซ๐ญ ๐ข๐ง๐ฌ๐ข๐๐ž ๐œ๐จ๐ง๐ญ๐š๐ข๐ง๐ž๐ซ..

    docker run -dit -p 8080:80 <image name>

Community and Social Footprints :

Did you find this article valuable?

Support Cloudnloud Tech Community by becoming a sponsor. Any amount is appreciated!

Learn more about Hashnode Sponsors
ย 
Share this