Skip to content

Instantly share code, notes, and snippets.

@peterkappus
Last active May 23, 2018 16:37
Show Gist options
  • Select an option

  • Save peterkappus/8015f475f5f274394a4dacc6cc9cbf98 to your computer and use it in GitHub Desktop.

Select an option

Save peterkappus/8015f475f5f274394a4dacc6cc9cbf98 to your computer and use it in GitHub Desktop.
Docker file mount demo.
#create a local html file
echo "<html><h1>Yo</h1></html>" > index.html
#start nginx inside a container
docker run -p 80:80 -v "$(PWD)":/usr/share/nginx/html:ro -d nginx &
#fire up a browser and point it at local host
open http://localhost
#get the container ID to kill it later...
docker ps
# Now go edit the html file and then reload the browser to see your changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment