Question: Part 1: Create an Image to Serve a Static File Some of your company's applications include simple static files to be served. You would like

Part 1: Create an Image to Serve a Static File Some of your company's applications include simple static files to be served. You would like to create separate containers to serve static content. For testing, you can use the Python http server in the standard library, which can be run using "python -m http.server -d " to serve the files in listening on the given port. Create a new folder /home/user/web2 with a Dockerfile and a subfolder www containing a static file to be served. Write the Dockerfile so that it includes the default Python http server command to run for the web server, using port 8001. Once you have assembled the necessary steps in your Dockerfile, execute the command to build it. Make a screen capture showing the successful build of the web2 image. Now that your image is built, create and run a container based on it. You may do this in several steps, or use the appropriate docker command to accomplish the task in a single step. Ensure that you connect port 8001 of the docker container to port 8001 on the host. Also ensure that you map the www subfolder you created to the directory in the container that you are serving your static file from. In Firefox, navigate to localhost:8001 to show the directory listing on port 8001, which should contain your static file. Make a screen capture showing the directory listing served on port 8001.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!