➜ test git:(master) ./test.sh # remove container if running $ docker rm -f test_test_1 test_test_1 # build image $ docker build --no-cache -t test . Sending build context to Docker daemon 62.98 kB Step 1 : FROM php:7.0.2-apache ---> 2f16964f48ba Step 2 : VOLUME /var/www/html/ ---> Running in 5de873648f49 ---> 428c0f421bff Removing intermediate container 5de873648f49 Step 3 : RUN touch /var/www/html/file_generated_inside_the_container ---> Running in 801429d9ba1f ---> 86c70bf6635d Removing intermediate container 801429d9ba1f Successfully built 86c70bf6635d # build container $ docker-compose up -d Creating test_test_1 # list local files $ ls -al html total 0 drwxr-xr-x 3 miqueladell staff 102 Jan 21 15:25 . drwxr-xr-x 8 miqueladell staff 272 Jan 21 16:12 .. -rw-r--r-- 1 miqueladell staff 0 Jan 21 15:22 file_from_local_filesystem # list container files $ docker exec -i -t test_test_1 ls -alR /var/www/html /var/www/html: total 4 drwxr-xr-x 1 1000 staff 102 Jan 21 14:25 . drwxr-xr-x 4 root root 4096 Jan 7 18:05 .. -rw-r--r-- 1 1000 staff 0 Jan 21 14:22 file_from_local_filesystem