Docker Community Forums

Share and learn in the Docker community.

Ubuntu 18.04 container error "failed to mount overlay: operation not permitted storage-driver=overlay2"

I’m running Docker Desktop 3.5.2 with Docker engine 20.10.7 on Mac OS 11.2.3.
I am trying to build an image that can serve as a pipeline image to build other images. We have successfully done this at work but I am trying to recreate it for personal use. I am using Ubuntu:18.04 as the base image and installing docker. The image built Ok and I can run it but dockerd fails to run. When I run the dockerd command in the container the message I see that appears to be the issue is
ERRO[2021-08-07T15:28:16.275659465Z] failed to mount overlay: operation not permitted storage-driver=overlay2

I have looked at this post about the overlay driver Use the OverlayFS storage driver | Docker Documentation
but I cannot get the overlay driver info because the command “docker info” results in “ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?”

Any help is appreciated.