Menu

Dipesh Majumdar

Blog and Paintings

Docker commands

docker-machine ip  ###if you are installing docker on windows - localhost won't work and this is what you have to run to get docker-machine ip

docker-machine ls ###

docker run --detach    --hostname gitlab.test.com --publish 443:443 --publish 80:80 --publish 32:22 --name gitlab_ee_test --restart always --volume /srv/gitlab/config:/etc/gitlab:Z  --volume /srv/gitlab/logs: /var/log/gitlab:Z --volume /srv/gitlab/data:/var/opt/gitlab:Z  gitlab/gitlab-ee:latest   ###run a container

same gitlab enterprise edition yaml file

 docker exec -it 8d198db1e8ee bash  ###Entering a container

docker info  ###check docker installation

docker-compose --version ###check docker compose installation

docker run -it alpine sh  ###create a container and get inside it

docker container ls     ###what containers are running
docker container ls -a   ###what containers are running

docker system df  ###how much space docker image is using

docker images
docker image ls
docker system prune -f
docker rmi image_id
docker rmi -f  image_id/name

docker stop  containerid1 contanerid2

delete multiple docker images - 

$ docker images |grep mpdev |awk -F' ' '{print $3}' |xargs docker rmi
Untagged: mpdev_api:latest
Deleted: sha256:c152dab96cacb9fc716b5dfb9516836e4c992e843d5f17fd55df1ef692faba50
Deleted: sha256:0919997f056c0f9e08a6a8c0700a6b5669d22602aa4c77e8fe3c5b43061a2f2f
Deleted: sha256:860548a383358c1ad67b0e402e64c8f5cca2c4b9992165deab974f4f388e04c1
Deleted: sha256:0c1bd7569b81d1eb5fdd03f41467c99f4f364faf8133d96c73027c91d371537d
Deleted: sha256:018b7a4a2d2f33bf46eacc7ead42fbeb126dc8276a474308619d4ad3674a523b
Deleted: sha256:25ebf6b02b787cbdb58b54b8e3762a36062cac702d64e30e939051ccfca7753a
Deleted: sha256:55c6d80942b0a9e581ac10c917d89a64fe12c83954cdc52f45fa31f766860023
Deleted: sha256:27ab350230d9345abdba3cd4c2bfed94e4fe409703ac1acd408bf1cd58197b3b
Deleted: sha256:7cf5181590ad11b2e39b8c94626e06989e0d8e6f257145f50201f2696fdf5321
Deleted: sha256:24ca683fc26ebd848c351b337fbf89a2eafc4c7bcd2a48220a78f63f8240f861
Deleted: sha256:2f0abbbe5d4895c53f7b17642c912bb5b5762ecbf3406bc81886146afafff7c6
Deleted: sha256:789eda5d666697a48856ff290f1090de9ce867f2ccac5c50f3a2111b152901e0
Deleted: sha256:e479afaeea9a40fda484a8733bd51077b3b136c6d577ac575668ec6cbedce5d7
Deleted: sha256:79eac68fd953206e1203d2ca380d35daec126ac9bc2a9cd30b04972ff25e9043
Deleted: sha256:96e285e3b7a0d41aac81eb7fdfcefc5e5a96e446ce84421c608323101d744491
Deleted: sha256:ae3a33c59572bd4962d19b5ea0f2b3522729383f616ae18ddfc1e7ec69e1ba33
Deleted: sha256:55b5e8dd2574f7bb21739c5a2d6d4f4932fb3bc751521896bd497c7e3c39d3b2
Deleted: sha256:8c9121be9e53f4df26961e72b55f27093b1e88936f5360edf847c9380ed7a538
Deleted: sha256:daf47760bc74b4dafd9de381981fc43ecbe070418c92f85c4007196b2a49cef7
Deleted: sha256:39db08d0918163ee3b723c1516a3908a07c552dce360171c2c283806710b8087
Untagged: mpdev_frontend:latest
Deleted: sha256:892475b401b5274f3c07f592dfd25ed831c1b912fcf2969d10d352a74765fa4f
Deleted: sha256:c4b0c8a099685d9d893b0aa84e85ee7cdbdd01810f0e0c3fb3bef753020e9c1f
Deleted: sha256:869eec1b65fdd16c0437c7e1754e7b2016fc2a258c31f162c6394c1f1a2ce06e
Deleted: sha256:d61ac53c759a15b09559a26a50b0d1b0fa72b8f561a00472c303b5169e48a165
Deleted: sha256:1ede2600b4872ce7883813f43265074e40ce7973abbcdfc41dede91e12006a33
Deleted: sha256:6b96c45e6caa7120ddc6302ce29534d4f425f47cf3798d69aa8968b5469e8971
Deleted: sha256:872d2513f4b25a7b09dcf65482f5c05af1329b6b31aa076bd88265a52ba0e6de
Deleted: sha256:a486379143c0b73f21ae22c4ceb917eccdc4abf5390a7fe1820e08782a6de00e
Deleted: sha256:7c03ae6327e76b91bc5d727d51671959907614f4672fba5cca064f52f2c8c8de
Deleted: sha256:f070c46d518eb9e4c6d3ea8110522d176ef753c8c6ae43d0529b6134c2994f36
Deleted: sha256:ab5f0c1c55fa7dfabf894f07387760e1a79873db6adac7682320af0b86fb3ca0
Deleted: sha256:a6f4c78e7346566b3a49e8d0a9e32f2be060abbaa7fff6e0b214ee23a7d6f151

 

 

 

Go Back

Comment