Docker: setup user operation not permitted

I tried to run GitHub - codeclimate/codeclimate: Code Climate CLI inside circle ci container, but received error.

ubuntu@box667$ docker run \

–interactive --tty --rm
–env CODE_PATH=“$PWD”
–volume “$PWD”:/code
–volume /var/run/docker.sock:/var/run/docker.sock
–volume /tmp/cc:/tmp/cc
codeclimate/codeclimate analyze
WARNING: Your kernel does not support memory swappiness capabilities, memory swappiness discarded.
Starting analysis
Running brakeman: Done!
error: (CC::Analyzer::Engine::EngineFailure) engine brakeman failed with status 1 and stderr
WARNING: Your kernel does not support memory limit capabilities. Limitation discarded.
time=“2016-02-20T19:01:05Z” level=fatal msg=“setup user operation not permitted”
time=“2016-02-20T19:01:06Z” level=fatal msg=“Error response from daemon: Cannot destroy container 5f1e776791250d08a32fe2b37ae30c439e7e9b6c8f58f411b2963a1ca8549f2b: Driver btrfs failed t
o remove root filesystem 5f1e776791250d08a32fe2b37ae30c439e7e9b6c8f58f411b2963a1ca8549f2b: Failed to destroy btrfs snapshot: operation not permitted”
Error deleting container: Error response from daemon: Cannot destroy container d1f9f4722eb9b47c276c7d7bc6451d4a416877aa9be4a978a973c519ab20dcb2: Driver btrfs failed to remove root files
ystem d1f9f4722eb9b47c276c7d7bc6451d4a416877aa9be4a978a973c519ab20dcb2: Failed to destroy btrfs snapshot: operation not permitted

If I receive rm flag I don’t receive error regarding btrfs, but looks like the root of the problem is user creation https://github.com/codeclimate-community/brakeman/blob/master/Dockerfile#L12.

Could you please suggest anything?

The problems are these two lines:

and #61

I removed both and built a custom docker image (https://hub.docker.com/r/etops/codeclimate/) which works.