Latest web development tutorials

Docker exec command

Docker command Daquan Docker command Daquan


docker exec: execute command in the Run vessel

grammar

docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

OPTIONS Description:

  • -d: Split mode: run in the background

  • -i: Even without additional STDIN also remains open

  • -t: allocate a pseudo-terminal

Examples

In the implementation of the container vessel mynginx /root/w3big.sh script in interactive mode

w3big@w3big:~$ docker exec -it mynginx /bin/sh /root/w3big.sh
http://www.w3big.com/

Open an interactive mode in the container terminal mynginx

w3big@w3big:~$ docker exec -i -t  mynginx /bin/bash
root@b1a0703e41e7:/#

Docker command Daquan Docker command Daquan