exec
docker exec -it <container name> /bin/bash
run
docker run -d --rm \
--name watchtower
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
alist
-d
flag to run the container in detached mode.--name
specify a name to the container--rm
to automatically delete it when it exits-p 8080:80
: Map TCP port80
in the container to port8080
on the Docker host.
rm
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)
docker rm $(docker ps -a -q)
Multi Stage Build
- Multi-stage builds | Docker Documentation
- Can be used to decrease the size of image since only optimized build is contained in image while dependencies are burnt.