From 02f6e8edebfef45e77d7068d7aa027216b1dad6d Mon Sep 17 00:00:00 2001 From: rohan Date: Sun, 29 Dec 2024 21:01:02 +0530 Subject: [PATCH] add docker volumes commands --- .husky/commit-msg | 0 tools/docker.sh | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) mode change 100755 => 100644 .husky/commit-msg diff --git a/.husky/commit-msg b/.husky/commit-msg old mode 100755 new mode 100644 diff --git a/tools/docker.sh b/tools/docker.sh index 66587bb5..8cb91269 100644 --- a/tools/docker.sh +++ b/tools/docker.sh @@ -1,6 +1,7 @@ ############################################################################## # DOCKER ############################################################################## +An open-source platform that automates the deployment, scaling, and management of applications within lightweight, portable containers. docker init # Creates Docker-related starter files docker build -t friendlyname . # Create image using this directory's Dockerfile @@ -31,7 +32,7 @@ docker network prune # Remove all unused networks ############################################################################## # DOCKER COMPOSE ############################################################################## - +A tool for defining and running multi-container Docker applications using a single YAML configuration file. docker-compose up # Create and start containers docker-compose up -d # Create and start containers in detached mode @@ -45,6 +46,21 @@ docker-compose scale = # Scale special service(s) docker-compose top # Display the running processes docker-compose run -rm -p 2022:22 web bash # Start web service and runs bash as its command, remove old container. + +############################################################################## +# DOCKER VOLUME +############################################################################## +It is a persistent data storage mechanism managed by Docker, allowing data to be stored and shared between containers. + +docker volume create # Create a volume +docker volume ls # List all volumes +docker volume inspect # Display detailed information on one or more volumes +docker volume rm # Remove one or more volumes +docker volume prune # Remove all unused local volumes +docker run -v : # Mount a volume +docker system df -v # Show docker disk usage + + ############################################################################## # DOCKER SERVICES ##############################################################################