與執行中的容器互動
docker exec [OPTIONS] CONTAINER COMMAND [ARG...]root@vm:/home/jennifer# docker exec -it b5e1 nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@vm:/home/jennifer#root@vm:/home/jennifer# docker exec -it b5e1 bash
root@b5e16239b697:/# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@b5e16239b697:/# time
real 0m0.000s
user 0m0.000s
sys 0m0.000sroot@b5e16239b697:/# exit # 在b5e1623b697容器內輸入exit
exit
root@vm:/home/jennifer# # 這裡已回到本機Last updated