From 053deb5ce2422ae99f3b1a71f669a8d81fdc8613 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 1 Sep 2017 07:16:31 +0000 Subject: [PATCH] ctr: net-host: bind-mount host /etc/{hosts,resolv.conf} Signed-off-by: Akihiro Suda --- cmd/ctr/run_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ctr/run_unix.go b/cmd/ctr/run_unix.go index e7fd02a5c..6056549bb 100644 --- a/cmd/ctr/run_unix.go +++ b/cmd/ctr/run_unix.go @@ -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...)