Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 756 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 756 Bytes

Demo 6

Introduction to volumes

Mount a folder with a static site and serve it. Read-write and read-only mounts.

Note: Make sure to execute the below commands in the demo directory.

docker run --name nginx -d -v $(pwd)/page:/usr/share/nginx/html -p 80:80 nginx:1.20-alpine
curl http://docker # On the workstation
docker exec nginx touch /usr/share/nginx/html/container_rw
ls -la page/
docker rm -f nginx
docker run --name nginx -d -v $(pwd)/page:/usr/share/nginx/html:ro -p 80:80 nginx:1.20-alpine
docker exec nginx touch /usr/share/nginx/html/container_ro
ls -la page/
docker rm -f nginx
rm -f page/container_rw

Navigation