Skip to content

Unable to run containerd example inside a Docker container #4350

Answered by cpuguy83
ghost asked this question in General
Discussion options

You must be logged in to vote

invalid argument is an error from the kernel.
Since this happened on mount, I'm going to assume it's due to trying to perform an overlay mount on top of another overlay.

What you'll need to do is either

  1. Ensure that /var/lib/containerd is backed by an fs supported by overlayfs
    i. Since you are running in docker this would be -v /var/lib/containerd, as an example.
  2. Use the native snapshotter, which doesn't rely on overlays or CoW.
	container, err := client.NewContainer(
		ctx,
		"redis-server",
		containerd.WithImage(image),
		containerd.WithNewSnapshot("redis-server-snapshot", image),
		containerd.WithNewSpec(oci.WithImageConfig(image)),
        containerd.WithSnapshotter("native"),
	)

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dmcgowan
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4350 on July 16, 2020 20:56.