The company site runs in the web container: busybox serves a page on port 8080. The container's image was built from the ~/site directory. A colleague edited index.html there — changed Site v1 to Site v2 — and restarted the container.
Repeat their check: look at the file, restart the container and open the page. On this machine docker commands go through sudo. “Start” will launch docker and the container.
Restart the container after the edit
In ~/site, print index.html, restart the web container, request the page on port 8080 and print index.html inside the container.
First, predict
index.html in ~/site is already fixed. What will curl show after the container restarts?
Now start the exercise, run the command and compare your prediction with the output.
Where does the web container get the page it serves?
-
curl keeps nothing between runs: each time it asks the server again, and the server returned
Site v1. -
docker exec web cat /www/index.htmlread the file from the container's disk, and it saysSite v1too. -
Then curl would have printed
Site v2, likecat index.htmlin~/site. It printedSite v1, like the file in the container's/www.
The container serves its own /www/index.html, and that file says Site v1.