安装:
cd /tmp; curl https://www.kernel.org/pub/linux/utils/util-linux/v2.25/util-linux-2.25.tar.gz | tar -zxf-; cd util-linux-2.25
sudo apt-get install autopoint autoconf libtool automake
./configure --without-python --disable-all-programs --enable-nsenter --without-ncurses
make nsenter; cp nsenter /usr/local/bin
使用:
docker inspect -f {{.State.Pid}} 容器id
5270
nsenter --target 5270 --mount --uts --ipc --net --pid
[size=medium][color=red]退出容器 容器不会关闭[/color][/size]
cd /tmp; curl https://www.kernel.org/pub/linux/utils/util-linux/v2.25/util-linux-2.25.tar.gz | tar -zxf-; cd util-linux-2.25
sudo apt-get install autopoint autoconf libtool automake
./configure --without-python --disable-all-programs --enable-nsenter --without-ncurses
make nsenter; cp nsenter /usr/local/bin
使用:
docker inspect -f {{.State.Pid}} 容器id
5270
nsenter --target 5270 --mount --uts --ipc --net --pid
[size=medium][color=red]退出容器 容器不会关闭[/color][/size]