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...)