gvisor/runsc/sandbox
Nicolas Lacasse 1bdec86bae Return better errors from Docker when runsc fails to start.
Two changes in this CL:

First, make the "boot" process sleep when it encounters an error to give the
controller time to send the error back to the "start" process. Otherwise the
"boot" process exits immediately and the control connection errors with EOF.

Secondly, open the log file with O_APPEND, not O_TRUNC. Docker uses the same
log file for all runtime commands, and setting O_TRUNC causes them to get
destroyed. Furthermore, containerd parses these log files in the event of an
error, and it does not like the file being truncated out from underneath it.

Now, when trying to run a binary that does not exist in the image, the error
message is more reasonable:

$ docker run alpine /not/found
docker: Error response from daemon: OCI runtime start failed: /usr/local/google/docker/runtimes/runscd did not terminate sucessfully: error starting sandbox: error starting application [/not/found]: failed to create init process: no such file or directory

Fixes #32

PiperOrigin-RevId: 196027084
Change-Id: Iabc24c0bdd8fc327237acc051a1655515f445e68
2018-05-09 14:13:37 -07:00
..
BUILD Check in gVisor. 2018-04-28 01:44:26 -04:00
console.go Check in gVisor. 2018-04-28 01:44:26 -04:00
hook.go Check in gVisor. 2018-04-28 01:44:26 -04:00
namespace.go Check in gVisor. 2018-04-28 01:44:26 -04:00
network.go Use the containerd annotation instead of detecting the "pause" application. 2018-05-08 11:11:50 -07:00
sandbox.go Return better errors from Docker when runsc fails to start. 2018-05-09 14:13:37 -07:00
sandbox_test.go Error if container requires AppArmor, SELinux or seccomp 2018-05-08 10:34:11 -07:00
status.go Check in gVisor. 2018-04-28 01:44:26 -04:00