Merge pull request #1458 from AkihiroSuda/net-host

ctr: net-host: bind-mount host /etc/{hosts,resolv.conf}
This commit is contained in:
Michael Crosby 2017-09-01 10:28:17 -04:00 committed by GitHub
commit 3e2a9c60af

View File

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