Docker Community Forums

Share and learn in the Docker community.

Error: Nonexistent driver overlay2 in Centos 7.9.2009

I am trying to run docker containers using docker-compose and to persist data i am using docker volumes.

Environment:
OS: Centos 7.9.2009 x86_64
Docker version: Docker version 19.03.9
Docker Compose Version: docker-compose version 1.26.2

I am specifying driver as overlay2 in the docker compose file.PFB for the volumes section

volumes:
my-data:
name: my-data-volume
driver: overlay2

I am getting the following error when running docker-compose up

ERROR: Volume my-data-volume specifies nonexistent driver overlay2

But when i Check docker info, i get the following output. Based on the output i see that Storage Driver is overlay2. But not sure why i am getting this error.Can anyone help me in resolving this issue

Client:
Debug Mode: false

Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 2
Server Version: 19.03.14
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog