libcontainer: Use pivot_root instead of chroot
libcontainer: Use pivot_root instead of chroot

Instead of keeping all the old mounts in the container namespace and
just using subtree as root we pivot_root so that the actual root in
the namespace is the root we want, and then we unmount the previous
mounts.

This has multiple advantages:

* The namespace mount tree is smaller (in the kernel)
* If you break out of the chroot you could previously access the host
  filesystem. Now the host filesystem is fully invisible to the namespace.
* We get rid of all unrelated mounts from the parent namespace, which means
  we don't hog these. This is important if we later switch to MS_PRIVATE instead
  of MS_SLAVE as otherwise these mounts would be impossible to unmount from the
  parent namespace.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

shenxiaochen/libcontainer,hqhq/libcontainer,ZJU-SEL/runc,shakamunyi/libcontainer,gitido/runc,estesp/libcontainer,sallyom/runc,YujiOshima/runc,calavera/runc,HuKeping/runc,adrianreber/runc,tangkun75/libcontainer,SaiedKazemi/libcontainer-criu,wking/runc,rhatdan/runc,meihuabo/runc,Mashimiao/libcontainer,cloudfoundry-incubator/runc,runcom/runc,keloyang/runc,han-wang/runc,whuwxl/libcontainer,wangkirin/runc,HardikDR/runc,balajibr/runc,crosbymichael/runc,Microsoft/libcontainer,keloyang/runc,subuser-security/runc,zhangyancoder/libcontainer,mheon/runc,BrickXu/libcontainer,keloyang/runc,BrickXu/libcontainer,xiaochenshen/runc,shishir-a412ed/runc,kolyshkin/runc,mYmNeo/runc,avagin/runc,InformatiQ/runc,docker/runc,YujiOshima/runc,mrunalp/libcontainer,wking/runc,laijs/runc,unclejack/libcontainer,maxamillion/runc,dqminh/runc,rhatdan/libcontainer,dqminh/runc,unclejack/libcontainer,hxfeng/runc,axsh/runc,kolyshkin/runc,subuser-security/runc,ycaihua/libcontainer,keloyang/libcontainer,cloudfoundry-incubator/runc,inatatsu/runc,navidshaikh/runc,hqhq/runc,sunyuan3/runc,LTD-Beget/libcontainer,crosbymichael/libcontainer,docker/libcontainer,sallyom/runc,wcwxyz/runc,shenxiaochen/libcontainer,nkwilson/runc,wcwxyz/runc,hxfeng/runc,LK4D4/runc,HuKeping/runc,mheon/libcontainer,whosthatknocking/runc,shishir-a412ed/runc,ekuric/runc,jwuwork/runc,ycaihua/libcontainer,justincormack/runc,gwoo/runc,thaJeztah/libcontainer,ddnbgroup/runc,rootfs/runc,carlye566/runc,han-wang/runc,balajibr/runc,ycaihua/runc,talwai/runc,thaJeztah/libcontainer,ycaihua/runc,jhowardmsft/runc,mikebrow/runc,albertoleal/runc,dieface/runc,boucher/runc,opencontainers/runc,carlye566/runc,rootfs/runc,haijunTan/runc,chenchun/runc,jwuwork/runc,stefanberger/runc,wcwxyz/runc,nkwilson/runc,docker/libcontainer,ChengTiesheng/runc,ZJU-SEL/libcontainer,LK4D4/runc,vbatts/runc,rhatdan/runc,rsampaio/runc,booyaa/runc,calavera/runc,nkwilson/runc,boucher/libcontainer,jhowardmsft/runc,maxamillion/runc,mheon/runc,docker/runc,dqminh/runc,willmtemple/runc,intfrr/runc,chenchun/runc,carlye566/runc,jhjeong-kr/runc,justincormack/runc,haijunTan/runc,coolljt0725/runc,shakamunyi/libcontainer,cxxly/runc,wangkirin/runc,booyaa/runc,zenlinTechnofreak/runc,ZJU-SEL/libcontainer,LTD-Beget/libcontainer,inatatsu/runc,wangkirin/runc,docker/runc,gitido/runc,WeiZhang555/runc,ZJU-SEL/libcontainer,mheon/libcontainer,cyphar/runc,coolljt0725/runc,YujiOshima/runc,aidanhs/runc,laijs/runc,hxfeng/runc,whuwxl/libcontainer,mrunalp/runc,mrunalp/libcontainer,balajibr/runc,sunyuan3/runc,axsh/runc,mikebrow/runc,shenxiaochen/libcontainer,mYmNeo/runc,icecrime/libcontainer,HardikDR/runc,zenlinTechnofreak/runc,ekuric/runc,markllama/runc,ZJU-SEL/runc,runcom/runc,estesp/runc,avagin/libcontainer,lizf-os/runc,rsampaio/runc,whosthatknocking/runc,WeiZhang555/runc,boucher/runc,ycaihua/libcontainer,calavera/runc,mrunalp/libcontainer,crosbymichael/runc,cxxly/runc,opencontainers/runc,mikebrow/runc,runcom/runc,vbatts/runc,clnperez/runc,xiaochenshen/runc,clnperez/runc,maxamillion/runc,icecrime/libcontainer,zhangyancoder/libcontainer,ycaihua/runc,ChengTiesheng/runc,cyphar/runc,dqminh/libcontainer,runcom/libcontainer,zhangyancoder/libcontainer,keloyang/libcontainer,marcosnils/runc,shishir-a412ed/runc,opencontainers/runc,estesp/runc,cyphar/runc,ChengTiesheng/runc,WeiZhang555/runc,crosbymichael/libcontainer,HardikDR/runc,w4ngyi/libcontainer,estesp/runc,keloyang/libcontainer,jwuwork/runc,LK4D4/runc,boucher/libcontainer,hqhq/libcontainer,Mashimiao/libcontainer,estesp/libcontainer,navidshaikh/runc,crosbymichael/runc,liuwharton/runc,mapk0y/runc,crosbymichael/libcontainer,mheon/runc,xiaochenshen/runc,ddnbgroup/runc,navidshaikh/runc,dqminh/libcontainer,docker/libcontainer,meihuabo/runc,clnperez/runc,rhatdan/runc,hqhq/runc,avagin/runc,mapk0y/runc,vbatts/runc,rhatdan/libcontainer,boucher/libcontainer,HuKeping/runc,talwai/runc,markllama/runc,runcom/libcontainer,marcosnils/runc,hqhq/runc,booyaa/runc,opencontainers/runc,Microsoft/libcontainer,abduld/runc,fabiokung/runc,whuwxl/libcontainer,SaiedKazemi/libcontainer-criu,gitido/runc,avagin/libcontainer,boucher/runc,jhjeong-kr/runc,han-wang/runc,abduld/runc,haijunTan/runc,kolyshkin/runc,dqminh/libcontainer,thaJeztah/libcontainer,abduld/runc,mapk0y/runc,intfrr/runc,milosgajdos83/libcontainer-milosgajdos83,mheon/libcontainer,fabiokung/runc,mYmNeo/runc,rhatdan/runc,zenlinTechnofreak/runc,willmtemple/runc,mrunalp/runc,adrianreber/runc,adrianreber/runc,w4ngyi/libcontainer,justincormack/runc,albertoleal/runc,albertoleal/runc,kolyshkin/runc,milosgajdos83/libcontainer-milosgajdos83,stefanberger/runc,InformatiQ/runc,tangkun75/libcontainer,kimh/runc,rajasec/runc,chenchun/runc,SaiedKazemi/libcontainer-criu,aidanhs/runc,rajasec/runc,lizf-os/runc,subuser-security/runc,Mashimiao/libcontainer,jhjeong-kr/runc,inatatsu/runc,avagin/runc,marcosnils/runc,tangkun75/libcontainer,unclejack/libcontainer,talwai/runc,mrunalp/runc,whosthatknocking/runc,dieface/runc,w4ngyi/libcontainer,wking/runc,dieface/runc,InformatiQ/runc,kimh/runc,meihuabo/runc,ZJU-SEL/runc,LTD-Beget/libcontainer,Microsoft/libcontainer,runcom/libcontainer,intfrr/runc,keloyang/libcontainer,ekuric/runc,rajasec/runc,estesp/libcontainer,stefanberger/runc,liuwharton/runc,rhatdan/libcontainer,hqhq/libcontainer,ddnbgroup/runc,lizf-os/runc,kimh/runc,fabiokung/runc,axsh/runc,liuwharton/runc,sallyom/runc,avagin/libcontainer,rsampaio/runc,markllama/runc,coolljt0725/runc,dqminh/runc,icecrime/libcontainer,jhowardmsft/runc,BrickXu/libcontainer,rootfs/runc,laijs/runc,cloudfoundry-incubator/runc,cxxly/runc,aidanhs/runc,shakamunyi/libcontainer,sunyuan3/runc,willmtemple/runc