Is OverlayFS (overlay and overlay2) supported for use with the docker container runtime?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux Atomic Host
  • docker

Issue

  • Can overlayfs or overlayfs2 be used when using the docker container runtime?
  • Can I use overlay or overlay2 as a backing filesystem for containers?

Resolution

  • RHEL / RHEL Atomic Host 7.3

    • OverlayFS (overlay)
      • Supported for docker containers on 7.3 provided the restrictions noted in the Release Notes for RHEL 7.3 are followed.
        • Host has SELinux enabled, but the docker daemon must have SELinux disabled
    • OverlayFS 2 (overlay2)
      • Technology Preview on 7.3
      • Host has SELinux enabled, but the docker daemon must have SELinux disabled
  • RHEL / RHEL Atomic Host 7.4

    • OverlayFS (overlay and overlay2)
      • Support for docker containers on 7.4 provided the restrictions noted in the Release Notes for RHEL 7.4 are followed:
        • Only XFS is supported for use as a lower layer file system
        • XFS file systems must be created with the -n ftype=1 option enabled for use as an overlay
        • OverlayFS provides a restricted set of the POSIX standards. Test your application thoroughly before deploying it with OverlayFS
        • In order to make the yum and rpm utilities work properly inside the container, the user should be using the yum-plugin-ovl packages
      • Support for SELinux enabled in docker daemon
        • Requires RHEL 7.4 kernel, 3.10.0-693.el7 or newer
        • Requires docker-1.12.6-48.git0fdc778.el7 or newer
  • RHEL / RHEL Atomic Host 7.5 and newer

    • For new installations the default docker storage driver has changed from devicemapper to overlay2
    • Existing installations that upgrade will not change
    • Same caveats/restrictions for OverlayFS continue to apply

Diagnostic Steps

See the Red Hat Enterprise Linux Atomic Host Managing Containers Guide, Chapter 1. Managing Storage with Docker-formatted Containers - Section 1.6. Using the Overlay Graph Driver for instructions on configuring the docker daemon to use the overlay2 storage backend.

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.