宿主机上对docker容器内的进程等操作

1. docker top [容器名|容器ID]

       docker top niop-20200611

2. docker exec [容器名|容器ID] ps -ef

        docker exec niop-20200611 ps -ef

3. docker exec [容器名|容器ID] ps -ef | grep '进程名' | awk '{print $2}' | xargs docker exec [容器名|容器ID] kill -9

        docker exec niop-20200611 ps -ef | grep niopex_spot_asset | awk '{print $2}' | xargs docker exec niop-20200611 kill -9

4. docker exec [容器名|容器ID]  [容器内执行脚本路径]

        docker exec niop-20200611 /opt/build/auto_run/niopex/quote.sh restart quote

 

 

 

你可能感兴趣的:(docker)