0

I want to mount current host dir to /var/www in container.

Dockerfile:

FROM php:8.0.0-fpm-alpine3.12
WORKDIR /var/www    
CMD ["php", "-S", "0.0.0.0:80", "-t", "/var/www"] 
docker build -t test .
docker run -d -v $(pwd):/var/www -p 80:80 test

docker inspect shows that it's mounted:

"Mounts": [
            {
                "Type": "bind",
                "Source": "/library/webserver/documents/test",
                "Destination": "/var/www",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

/library/webserver/documents/test is between shared dir's in Docker Desktop preferences, but host files are not visible from container and vice versa. Why it's not working? Thanks

0 Answers0