5

I'm having difficulty setting up Docker to build a container with the XFS Filesystem. My Storage Driver is correctly set to overlay2, but my Backing Filesystem is extfs.

Is there something I would specify for storage-opts in my docker daemon file?

Nick
  • 77
  • 1
  • 6

1 Answers1

5

If you are using the overlay2 storage driver, then Docker never creates filesystems. It is simply creating directories on your existing backing filesystem. If that filesystem is using ext4, that's what you're going to get.

The only situation in which Docker actually creates a new filesystem is when using the devicemapper driver, in which case Docker is carving out chunks from a block storage device and then formatting them for use with the filesystem of your choice.

larsks
  • 277,717
  • 41
  • 399
  • 399
  • 1
    Ah understood. Would you recommend I use `devicemapper` over `overlay2` in order to resolve the following warning from a dockerized mongodb instance: `** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine ** See http://dochub.mongodb.org/core/prodnotes-filesystem` – Nick Dec 24 '17 at 05:01
  • 3
    I would just ensure that `/var/lib/docker` is a dedicated filesystem, format that with XFS, and continue to use the `overlay2` storage driver. It's generally more performant than `devicemapper`. – larsks Dec 24 '17 at 05:07
  • It means that you cannot choose the filesystem of docker. It chooses for you based on your storage driver? – runzhi xiao Dec 10 '21 at 10:37
  • You can obviously select which filesystem you use for the backing store of the `overlay2` driver, but you cannot select the filesystem used individually by each container. – larsks Dec 11 '21 at 13:47