cherry pick pr#8474

Signed-off-by: Victor Vieux <vieux@docker.com>