Apache2 in docker container gives 403 on statically served files
I’m having a weird issue and am looking for ideas.
I’m running an apache2 debian image that serves some static files, and has a few redirect rules.
Running a container works fine, but results in 403 (permission denied) errors on any request (curl as well as browser).
When I then exec into the container and perform an
ls in a static file folder (such as css), those files are being served correctly on the next request.
My current workaround is a startup script with a
find /var/www/html/ -name '*'. This makes the container work as expected, with all the served files being accessible.
- All the files have the correct owner (www-data) and permissions.
- Docker version 1.7.1, but issue appeared also on 1.7.0
- I’m running an Ubuntu VM, but my colleague reproduced this on a mac with docker machine.
Whatever could be a reason for this behaviour?