til/src/Development/docker.md

1.3 KiB

Docker

Distribution Package
Arch Linux docker
Ubuntu See

Enable and start service:

systemctl enable --now docker.service

Add your user to docker group:

sudo usermod -aG docker $USER

Delete all images, containers, volumes, and networks that are not associated with a container (dangling):

docker system prune

Read docker run.

option example explain
-i Keep STDIN open even if not attached
--name
-p -p 8080:80 Publish container port : host port
--rm
-t Allocate a pseudo-TTY
-v -v ~/abc:/abc Bind host directory : container directory

Example run ubuntu image:

docker run --rm -it ubuntu