docker

hrk1l2x

2 minute read

# process list
docker ps -a

# connect the container
# -i interactive mode
# -t activate virtual device
# `$ docker attach {container}` can attach also but you exit container then container are stopped at the same time. because you attach PID=1 with standard input and output in container.
docker exec -it --user root {container_id} /bin/bash

# exec command on container
docker exec {container_id} {command}

# stop container
docker stop {container_id}

# run all containers
docker restart $(docker…