Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 732 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 732 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

Navigation