Having the exact same issue with no luck! So happy (i think) to see someone else with the same issue
I’ve worked out it is as simple as moving files from one location to another on a shared host volume.
Steps to reproduce, every time.
Pull:
docker pull mysql
Run:
docker run -d -v /Users/username/Documents/data:/opt/:rw -e MYSQL_ROOT_PASSWORD=password mysql
Connect:
docker exec -t -i CONT_ID bash
cd /opt/
apt-get update
apt-get install git
git clone GitHub - guzzle/promises: Promises/A+ library for PHP with synchronous support
mv /opt/promises/src /opt/
Then ls -la /opt/src/ and all files permissions are FUBAR.
I’m using beta Docker for Mac
Docker version 1.11.1, build 5604cbe
If I do not use shared volumes, the permissions are not affected.