docker ps
: Lists Docker processes (running containers)docker image
: Lists Docker images pulled on the machinedocker run -it ubuntu
orwinpty docker run -it ubuntu
: Runs the Ubuntu image in a Docker containerroot@123wers12:/#
: The prompt inside the containerroot
: The user@
: Divider123wers12
: The operating system's machine name/
: The directory#
: Superuser$
: Normal user
ctrl + l
: Changes the view in Git Bashecho <whatever you want>
: Prints the given textdocker rmi $(docker images -q)
: remove all docker imagesdocker stop $(docker ps -q)
: stop all docker containers
Additional Docker Commands:
docker ps
: Lists Docker containersdocker run ubuntu
: Starts and destroys a Docker containerdocker run -it ubuntu sh
: Starts the Ubuntu image in a container and gets inside the containerit
: Interactive mode (option)sh
: Starts an interactive shell inside the Ubuntu container
mkdir iqbal
: Creates a new directorycd
: Changes the current directory#
: Superuser prompt$
: Normal user prompttouch filename
: Creates a new file in Linuxcd ..
: Goes back to the previous folderdocker exec -it <redis_container_name_or_id> redis-cli FLUSHALL
: This command will connect to the Redis server within the container and remove all data. The container will continue running with an empty Redis database.
docker run --name mysql-b2c-settings
-e MYSQL_ROOT_PASSWORD=root
-e MYSQL_DATABASE=b2c-settings
-p 3306:3306
-d mysql:latest