March 25, 2017

Storage Driver

Storage Driver

  • A storage driver is how docker implements a Union File System
    • File System choices include: AUFS (default on Ubuntu), Device Mapper (default on Red Hat and Centos), btrfs, OverlayFS, VFS, ZFS,…
      • AUFS
        • AUFS is a unification filesystem
          • AUFS stacks multiple directories on a single Linux host and exposes them as a single unified view through a single mount point
          • To achieve this, AUFS uses a union mount.
          • The directories in the stack, and the union mount point, all must exist on the same Linux host
          • AUFS refers to each directory in the stack as a branch.
        • AUFS supports the copy-on-write (CoW) technology
        • oldest driver, default for Ubuntu, file level operation (CoW operations copy entire files)
        • runs at native speeds, leverages memory sharing and scales well
        • not well suited for working with large files (databases, logs, etc.)
        • it needs to be added as part of the installation process, as it's not in the mainline Linux kernel
        • containers with many changes will result in many branches and long traversal times
        • AUFS storage driver deletes a file from a container by placing a whiteout file (.wh.<filename>) in the container’s top layer
          • The whiteout file effectively obscures the existence of the file in the read-only image layers below.
        • "AuFS is a layered file system, so you can have a read only part and a write part which are merged together
          • One could have the common parts of the operating system as read only (and shared amongst all of your containers)
          • and then give each container its own mount for writing."
      • Device Mapper
        • contributed by Red Hat
        • works at the block level with thin provisioning
        • features include RAID, disk encryption, snapshots; complexity over AUFS, less visibility into diffs between images and containers due to block level operation
      • btrfs (B-tree file system)
        • is a Linux filesystem that Docker supports as a storage backend
  • Storage driver is also used in the context of the Storage backend for Docker Trusted Registry
    • Choice of where the actual images are to be stored:
      • Local file system
      • AWS S3
      • Azure Blobs
  • Storage driver:
    • Enables operational flexibility to choose a solution that fits particular use cases
    • Helps enable the Docker philosophy of "batteries included, but replaceable"

    References:

No comments:

Post a Comment