深入了解Docker背后的namespace技术
/etc/hosts type ext4 (rw,relatime,errors=remount-ro,data=ordered) devpts on /dev/console type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) 上面是在我的demo容器中看到的挂载点。为了创建一个新的mount namespace,我们使用CLONE_NEWNS标志位。大家可以注意到这个标志位名称有点奇怪,为什么不是 CLONE_NEWMOUNT或者CLONE_NEWMNT呢?这是因为mount namespace是Linux中的第一个命名空间,所以这里的这里的标记位参数名字有点不符合常规,经常我们在编码实现一个新的特性或者应用的...阅读全文