1. Role
Execute commands in the running container
2. Grammar
docker exec [OPTIONS] CONTAINER COMMAND [ARG...]
OPTIONS Description:
-
-d: Split mode: running in the background
-
-i: Even without additional remains open STDIN
-
-t: assign a pseudo-terminal
3. Case
3.1 the container into the container ID
# docker ps -a # docker exec -it 9df70f9a0714【容器ID】 /bin/bash
Reference: https://www.jianshu.com/p/d858d3cfd427