sudo docker-compose up -d
sudo docker-compose down
sudo docker rm $(docker ps -a -q -f status=exited)
sudo docker container prune
sudo docker rm 305297d7a235 ff0a5c3750b9
305297d7a235 = container id
sudo docker ps -a
sudo docker run -it busybox sh
busybox = image name
To exit the container (type exit and press Enter)
sudo docker run --rm prakhar1989/static-site
prakhar1989/static-site = image name
--rm = remove the container once exited
sudo docker run -d -P --name static-site prakhar1989/static-site
-d = detach terminal
-P = export port randomly
--name = give a container name
static-site = container name
prakhar1989/static-site = image name
sudo docker port static-site
static-site = container name
sudo docker run -p 8888:80 prakhar1989/static-site
-p = export port by assigned number
8888 = exported port
80 = docker port
sudo docker stop static-site
static-site = container name
sudo docker images
sudo docker build -t shuvo575/catnip .
shuvo575/catnip = image name
( . ) = Dot is mandatory here
sudo docker run -p 8888:5000 shuvo575/catnip
sudo docker exec -it lamp-php8 /bin/bash
lamp-php8 = container name
/bin/bash = open terminal
-it = give us interactive TTY
exec = execute command