Question: I am having issues getting this to work. When I perform the docker build -t command I get a name resolution error. This is my
I am having issues getting this to work. When I perform the docker build -t command I get a name resolution error.
This is my script so far
FROM python:3 WORKDIR ~/web2 COPY . ~/web2/www EXPOSE 8001 CMD ["python". "-m", "http.server", "8001"
These are the instructions
For testing, you can use the Python http server in the standard library, which can be run using "python -m http.server -d
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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
