oracle / railcar

RailCar: Rust implementation of the Open Containers Initiative oci-runtime
Other
1.12k stars 101 forks source link

Fixes for Docker 17.12 #30

Closed vishvananda closed 6 years ago

vishvananda commented 6 years ago

The recent changes to containerd in docker 17.12 broke railcar in two ways:

1) The containerd-shim blocks waiting to receive the console file descriptor in create. Railcar was previously not creating the console until start was called.

2) The containerd-shim sets PR_SET_CHILD_SUBREAPER to 1. Railcar was using a double fork and exiting the parent during start to force the child to reparent to rc-init. Unfortunately, this setting causes it to reparent to containerd-shim instead, breaking the exit detection of the init process.

This was fixed by switching to a technique that is similar to docker. The console file descriptor is passed back during create. Start simply calls does the hooks and then triggers rc-init to exec the configured process. The old behavior can be recovered by passing --no-trigger to railcar create.

This also includes some other minor fixes and cleanups to various commands.

vishvananda commented 6 years ago

Ok as far as i can tell, this now works with both old and new versions of docker so I'm going to merge it.