Docker: SELinux relabeling issue for a local nfs volume

Solution Verified - Updated -

Issue

  • With the latest update of docker (rhel7 extra repo), we encounter a bug with nfs volumes (local driver):

    # docker volume create -d local --name xxx --opt type=nfs --opt o=addr=xxxx,rw,actimeo=0,sync --opt device=</path/to/dir> 
    # docker run --rm -ti -v xxx:xxx --name <container name> <image name> /bin/bash
    
  • The above command reports below error:

    ERROR: for <service name>  Cannot create container for service php-local: SELinux relabeling of /var/lib/docker/volumes/image/_data is not allowed: "operation not supported"
    

Environment

  • Red Hat Enterprise Linux (RHEL) 7.3
  • docker-1.12.6-28.git1398f24.el7.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content