做一个项目快一年了,这个项目一直在Docker上工作。今天发现整个文件系统的权限都变成了777(所有文件“-rwxrwxrwx”)。我不知道为什么会发生这一切,我想解决它。
我运行了两个 Bash 命令:
find ./ -type -d exec chmod 755 {} \;
find ./ -type -f exec chmod 644 {} \;
Run Code Online (Sandbox Code Playgroud)
之后我想看看结果,我运行了这个命令ls -l,我看到了这样一条消息Permission denied,这是可能发生的最糟糕的事情。我无法运行一个命令,并决定离开容器。在那之后,噩梦开始了。现在,当我尝试再次启动容器时,出现以下错误
Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"bash\": executable file not found in $PATH": unknown
Error: failed to start containers:
Run Code Online (Sandbox Code Playgroud)
我不想考虑最坏的情况,因为我不能失去这个容器,我真的需要它。我的操作系统 Ubuntu 18.04。