Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running with custom containerd snapshotter #132

Open
ChanderG opened this issue Mar 30, 2022 · 0 comments
Open

Running with custom containerd snapshotter #132

ChanderG opened this issue Mar 30, 2022 · 0 comments

Comments

@ChanderG
Copy link

So, I am trying to setup a Nomad in Docker kind of dev setup with containerd to run Nomad tasks. Due to the "containerd" on top "docker" situation, the default "overlayfs" snapshotter doesn't work.

With some effort, I have been able to get "fuse-overlayfs" working with containerd inside a docker container. So with some config and env variable updates (namely CONTAINERD_SNAPSHOTTER), I can pull images using ctr and run nerdctl without problems.

Now, I want to run containers via nomad -> nomad-driver-containerd -> containerd. With some experimentation, the only way I can get this to work is using the following patch:

--- a/containerd/containerd.go
+++ b/containerd/containerd.go
@@ -109,6 +109,7 @@ func (d *Driver) pullImage(imageName, imagePullTimeout string, auth *RegistryAut
 
 	pullOpts := []containerd.RemoteOpt{
 		containerd.WithPullUnpack,
+		containerd.WithPullSnapshotter("fuse-overlayfs"),
 		withResolver(d.parshAuth(auth)),
 	}
 
@@ -339,6 +340,7 @@ func (d *Driver) createContainer(containerConfig *ContainerConfig, config *TaskC
 	return d.client.NewContainer(
 		ctxWithTimeout,
 		containerConfig.ContainerName,
+		containerd.WithSnapshotter("fuse-overlayfs"),
 		containerd.WithRuntime(d.config.ContainerdRuntime, nil),
 		containerd.WithNewSnapshot(containerConfig.ContainerSnapshotName, containerConfig.Image),
 		containerd.WithNewSpec(opts...),

The image is pulled and the container started without issues, if I use the above version.

So, I have two questions:

  1. Am I missing something, or is this the only way to override the snapshotter setting? (I assumed that setting the default snapshotter in the containerd config would work, but it did not.)
  2. If this is the only way, would you accept a PR making the snapshotter configurable?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant