This is a simplification of how the docker engine implements this feature, but it will be ported there once this is merged. Signed-off-by: David Calavera <david.calavera@gmail.com>