Permission error for /drone/src

I’m trying to get started with drone-cli running a local build. I have an example drone configuration:

pipeline:
  build:
    image: ubuntu
    commands:
      - pwd
      - whoami
      - ls -al /drone
      - ls -al /drone/src

Any access to /drone/src results in a permission error, as below.

[snorf@lt-10578 drone-hello]$ drone exec
[build:L0:0s] + pwd
/drone/src
[build:L1:0s] + whoami
[build:L2:0s] root
[build:L3:0s] + ls -al /drone
[build:L4:0s] total 16
[build:L5:0s] drwxr-xr-x. 3 root root 4096 Jan  4 11:41 .
[build:L6:0s] drwxr-xr-x. 1 root root 4096 Jan  4 11:41 ..
[build:L7:0s] drwxrwxr-x. 2 1000 1000 4096 Jan  4 11:35 src
[build:L8:0s] + ls -al /drone/src
[build:L9:0s] ls: cannot open directory '/drone/src': Permission denied
2018/01/04 11:41:17 drone_step_0 : exit code 2

Running Fedora 27 (docker installed via yum) and drone-cli 0.8.0 binary installed from the releases page on GitHub.

Any idea what’s going wrong here? Perhaps related to the folder ownership (1000)?

It seems that SELinux is the issue. It’s a problem with docker rather than drone specifically. However, I think drone needs to be modified to do the shared mount differently - see SO answer below.