遇到问题
[root@server ~]# docker exec -it dc67d9d67ad3 /bin/ls /opt/
rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused \"process_linux.go:75: starting setns process caused \\\"fork/exec /proc/self/exe: no such file or directory\\\"\"\n"
如果/bin/bash和/bin/sh 都报错,估计是执行了docker restart<容器id>
将容器stop再重新start。
过程
[root@server ~]# docker exec -it dc67d9d67ad3 /bin/sh
rpc error: code = 13 desc = invalid header field value "oci runtime error: exec failed: container_linux.go:247: starting container process caused \"process_linux.go:75: starting setns process caused \\\"fork/exec /proc/self/exe: no such file or directory\\\"\"\n"
[root@server ~]# docker stop dc67d9d67ad3
dc67d9d67ad3
[root@server ~]# docker start dc67d9d67ad3
dc67d9d67ad3
[root@server ~]# docker exec -it dc67d9d67ad3 /bin/bash
root@dc67d9d67ad3:/#