dockerdocker-in-docker

overlay2 driver not supported


I am running a GitHub agent inside AKS cluster with Docker installed. I can run it successfully with VFS storage driver, however I want to use Overlay 2 because it's faster. I get the following message:

sudo dockerd &
...
INFO[2021-06-12T22:38:41.674415376Z] containerd successfully booted in 0.029163s
INFO[2021-06-12T22:38:41.692284696Z] parsed scheme: "unix"                         module=grpc
INFO[2021-06-12T22:38:41.692316597Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-06-12T22:38:41.692340397Z] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-06-12T22:38:41.692352097Z] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2021-06-12T22:38:41.693462211Z] parsed scheme: "unix"                         module=grpc
INFO[2021-06-12T22:38:41.693484611Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2021-06-12T22:38:41.693505611Z] ccResolverWrapper: sending update to cc: {[{unix:///var/run/docker/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2021-06-12T22:38:41.693519612Z] ClientConn switching balancer to "pick_first"  module=grpc
ERRO[2021-06-12T22:38:41.702131518Z] failed to mount overlay: invalid argument     storage-driver=overlay2
INFO[2021-06-12T22:38:41.702558423Z] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby
INFO[2021-06-12T22:38:41.702674724Z] stopping healthcheck following graceful shutdown  module=libcontainerd
failed to start daemon: error initializing graphdriver: driver not supported

My /etc/docker/daemon.json settings:

{
  "storage-driver": "overlay2",
  "storage-opts": [
    "overlay2.override_kernel_check=true"
  ]
}

Filesystem types:

Filesystem     Type     Size  Used Avail Use% Mounted on
overlay        overlay   49G   20G   29G  41% /
tmpfs          tmpfs     64M     0   64M   0% /dev
tmpfs          tmpfs    3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1      ext4      49G   20G   29G  41% /etc/hosts
shm            tmpfs     64M  8.0K   64M   1% /dev/shm
tmpfs          tmpfs    3.9G   12K  3.9G   1% /run/secrets/kubernetes.io/serviceaccount

Kernel version: 5.4.0-1046-azure


Solution

  • overlay        overlay   49G   20G   29G  41% /
    

    From the filesystem, it looks like you are running within a container. With Docker-in-Docker, typically you'll have a volume mounted at /var/lib/docker to get the docker filesystems off of container's overlay filesystem because you can't do overlay on top of overlay. The docs on storage driver backing filesystems shows the supported underlying filesystems for each storage driver.

    If you can't implement a volume mount for docker, then you're limited to vfs which works everywhere but is very disk intensive (the entire filesystem is copied for each layer), or fuse-overlayfs which is typically used for rootless installs and may not be available for your use case.