Last active
May 23, 2018 16:37
-
-
Save peterkappus/8015f475f5f274394a4dacc6cc9cbf98 to your computer and use it in GitHub Desktop.
Docker file mount demo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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