(Xiv) docker exec Detailed

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

Guess you like

Origin www.cnblogs.com/shix0909/p/11128678.html