Docker Community Forums

Share and learn in the Docker community.

Error setting up overlay2 on centos

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
Kernel Version:3.10.0-1160

Following is my /etc/docker/daemon.json

{
“storage-driver”: “overlay2”
}

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 understanding 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

Even i was able to do ls -l /var/lib/docker/overlay2
total 4
drwx------. 4 root root 72 Sep 29 19:15 0a1f2689ccb78d8034106773b9a4d88efb4761dfb5a1ddb8355862daa9306454
drwx------. 4 root root 72 Sep 29 19:15 12641a1ff294f0c1f6dc8ee8c5bec028d05b4f01aef8259e7cd72352847c5c9a
drwx------. 3 root root 47 Sep 29 19:15 17e23615d03313c111222c3a49bc0dc6985ce49a1014086fea908b328c113d36
drwx------. 5 root root 69 Sep 29 20:37 1e00c1f4dec63e388b38a2ba5a5b48142e16de5c36632258c8ddf8cc92327d6e
drwx------. 4 root root 72 Sep 29 20:05 1e00c1f4dec63e388b38a2ba5a5b48142e16de5c36632258c8ddf8cc92327d6e-init
drwx------. 4 root root 72 Sep 29 19:15 23fe5d26fdb506e156333a20c05001d1151bce9b09da5c007f3afffb286e9681
drwx------. 4 root root 72 Sep 29 19:15 3e408a77ea484c5443b49be38d1935394f56353b9d01aeae328b73736f75a009
drwx------. 4 root root 72 Sep 29 19:15 58d5d206ad2b67df1f2a2e692d1d6fa1bb02cb5390a657d920c9414c6eeb2546
drwx------. 4 root root 72 Sep 29 19:15 5fb2e8f1e2ea30c9c7516b9aaf999b64647e469bcccdc307f9a601ccde19512b
drwx------. 4 root root 72 Sep 29 19:15 9b02b714e5b5b7c4dffe94009bc64ae428add3edda862a9dcb78b1b5df85143d
drwx------. 4 root root 72 Sep 29 19:15 a7cd638ce69ac6413e04335135e77e36363681801e6d7baf67beefaf48a1788c
drwx------. 4 root root 72 Sep 29 19:15 a99751213b9ce9f892b392d53b743d8ca7dc6929b097655d85d9fbc5316931af
drwx------. 4 root root 72 Sep 29 19:15 b81e4ae26a87c759473bfb5572a33041a9ac9ce93066018e7b6399fd475cc294
brw-------. 1 root root 253, 6 Sep 29 20:37 backingFsBlockDev
drwx------. 4 root root 72 Sep 29 19:15 c19bc2d7e877ce033265f494840e3248f05a2acab461bd2198582aa9ba8a22ab
drwx------. 4 root root 72 Sep 29 19:15 eb60ee249ab3c38ee48b9bcda28a282bf990d7832864f04dce2ca760eb3edf9e
drwx------. 4 root root 72 Sep 29 19:15 ebe6cfd82c4ae3f47748c96f43296a206a642bb1033a256a1e1e920d9c2fb916
drwx------. 4 root root 72 Sep 29 19:16 f265e90f7a1372b14e706761c6e89e36fc6492eb92489324508c1b737944d80e
drwx------. 4 root root 72 Sep 29 19:15 f7f740aac03961d2c41390509137bb44d6697b11e71d6ad88ca31cbf543e7f9f