ctr: net-host: bind-mount host /etc/{hosts,resolv.conf}

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2017-09-01 07:16:31 +00:00
parent 22df20b35f
commit 053deb5ce2

View File

@ -109,7 +109,7 @@ func newContainer(ctx gocontext.Context, client *containerd.Client, context *cli
opts = append(opts, withTTY())
}
if context.Bool("net-host") {
opts = append(opts, setHostNetworking())
opts = append(opts, setHostNetworking(), containerd.WithHostHostsFile, containerd.WithHostResolvconf)
}
cOpts = append([]containerd.NewContainerOpts{containerd.WithNewSpec(opts...)}, cOpts...)
return client.NewContainer(ctx, id, cOpts...)