Skip to content

EROFS: rwlayer.img failure when the docker image has a Volumes attribute #12834

Description

@Champ-Goblem

Description

When attempting to run an image that was built with the dockerfile VOLUME instruction, the EROFS snapshotter fails to create the rwlayer.img file. This happens with runc and Kata.

The error seen in Kubernetes:

  Warning  Failed     4s               kubelet            Error: failed to create containerd container: failed to mount: could not open backing file: /var/lib/containerd/io.containerd.snapshotter.v1.erofs/snapshots/936/rwlayer.img: open /var/lib/containerd/io.containerd.snapshotter.v1.erofs/snapshots/936/rwlayer.img: no such file or directory

An example dockerfile which triggers the issue:

FROM ubuntu:latest

VOLUME /data

Current containerd config:

disabled_plugins = ["io.containerd.internal.v1.restart"]
oom_score = -999
required_plugins = ["io.containerd.grpc.v1.cri"]
version = 2

[debug]
  level = "info"

[grpc]
  gid = 109

[metrics]
  address = "0.0.0.0:1447"

[plugins]

  [plugins."io.containerd.grpc.v1.cri"]
    enable_cdi = true
    image_pull_progress_timeout = "5m"
    max_container_log_line_size = 262144
    sandbox_image = "europe-west4-artifactregistry.gcr.io/gke-release/gke-release/pause:3.8@sha256:880e63f94b145e46f1b1082bb71b85e21f16b99b180b9996407d61240ceb9830"
    stream_server_address = "127.0.0.1"

    [plugins."io.containerd.grpc.v1.cri".cni]
      bin_dir = "/home/kubernetes/bin"
      conf_dir = "/etc/cni/net.d"
      conf_template = ""

    [plugins."io.containerd.grpc.v1.cri".containerd]
      default_runtime_name = "runc"
      discard_unpacked_layers = false

      [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]

        [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
          runtime_type = "io.containerd.runc.v2"
          snapshotter = "erofs"

          [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
            SystemdCgroup = true

  [plugins."io.containerd.service.v1.diff-service"]
    default = ["erofs", "walking"]

  [plugins."io.containerd.snapshotter.v1.erofs"]
    default_size = "200GiB"
    enable_fsverity = false
    max_unmerged_layers = 0
    mkfs_options = ["-T0", "--mkfs-time", "--sort=none"]

Steps to reproduce the issue

  1. Start containerd with the above config
  2. Start a container using an image which contains a volume directive
  3. Observe the failure

Describe the results you received and expected

The container should start correctly.

What version of containerd are you using?

Main built from: 317286ac00e07bebd7d77925c0fef2af0d620e40

Any other relevant information

mkfs.erofs --version: 1.8.10-g42a630d3

Show configuration if it is related to CRI plugin.

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions