无法对任何正在运行的 Docker 容器执行命令

无法对任何正在运行的 Docker 容器执行命令

我可以用 启动容器docker run,并且它运行没有问题。但是我现在无法docker exec对正在运行的容器执行任何命令。错误如下:

rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:262: starting container process caused "process_linux.go:81: executing setns process caused \"exit status 16\""

我尝试重新安装 docker-ce,但没有帮助。

操作系统:Ubuntu 14.04

Docker 版本:17.06.0-ce

调试日志:(执行ls命令)

time="2017-08-07T14:43:20.322501870+08:00" level=debug msg="Calling GET /_ping" 
time="2017-08-07T14:43:20.323172954+08:00" level=debug msg="Calling GET /v1.30/containers/nginx/json" 
time="2017-08-07T14:43:20.326391920+08:00" level=debug msg="Calling POST /v1.30/containers/nginx/exec" 
time="2017-08-07T14:43:20.326569848+08:00" level=debug msg="form data: {\"AttachStderr\":true,\"AttachStdin\":true,\"AttachStdout\":true,\"Cmd\":[\"ls\"],\"Detach\":false,\"DetachKeys\":\"\",\"Env\":null,\"Privileged\":false,\"Tty\":true,\"User\":\"\"}" 
time="2017-08-07T14:43:20.327753849+08:00" level=debug msg="Calling POST /v1.30/exec/e4588970b41fa93cdbdd7bbebbffdc7817d8fd4a18687861ed320c51cb527e6f/start" 
time="2017-08-07T14:43:20.327856675+08:00" level=debug msg="form data: {\"AttachStderr\":true,\"AttachStdin\":true,\"AttachStdout\":true,\"Cmd\":[\"ls\"],\"Detach\":false,\"DetachKeys\":\"\",\"Env\":null,\"Privileged\":false,\"Tty\":true,\"User\":\"\"}" 
time="2017-08-07T14:43:20.327976854+08:00" level=debug msg="starting exec command e4588970b41fa93cdbdd7bbebbffdc7817d8fd4a18687861ed320c51cb527e6f in container 5d10eab31fc90c61ad84ef3154bccd20b007d2ea003d8e50895272f032306066" 
time="2017-08-07T14:43:20.328296621+08:00" level=debug msg="Calling POST /v1.30/exec/e4588970b41fa93cdbdd7bbebbffdc7817d8fd4a18687861ed320c51cb527e6f/resize?h=38&w=155" 
time="2017-08-07T14:43:20.328365273+08:00" level=debug msg="attach: stdin: begin" 
time="2017-08-07T14:43:20.328468280+08:00" level=debug msg="attach: stdout: begin" 
time="2017-08-07T14:43:20.377123769+08:00" level=error msg="Error running exec in container: rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:262: starting container process caused \"process_linux.go:81: executing setns process caused \\\"exit status 16\\\"\"\n" 
time="2017-08-07T14:43:20.377298515+08:00" level=debug msg="attach: stdout: end" 
time="2017-08-07T14:43:20.377257756+08:00" level=debug msg="Closing buffered stdin pipe" 
time="2017-08-07T14:43:20.377367558+08:00" level=debug msg="attach: stdin: end" 
time="2017-08-07T14:43:20.378569162+08:00" level=debug msg="Calling GET /v1.30/exec/e4588970b41fa93cdbdd7bbebbffdc7817d8fd4a18687861ed320c51cb527e6f/json" 

欢迎任何想法。

答案1

使用systemctl restart docker修复了这个问题。

相关内容