Juliette TworseyFront End Web Development Techdegree Graduate 32,403 Points
Docker course files?
Are the course files available for download somewhere?
Also, I am unable to connect to localhost:8080. What could be the issue?
Here is my Dockerfile:
# Base image FROM ubuntu:latest # Commands to run to install dependencies RUN apt-get update -y RUN apt-get install -y python3 # When you pass commands to the container, what should interpret them ENTRYPOINT ["python3"] # Command to run when the container starts CMD ["app.py"] # Working directory WORKDIR /app # Copy apps from the local folder to the Docker container COPY app.py app.py COPY alternate.py alternate.py # Make port available EXPOSE 8080
Jared SmithTreehouse Guest Teacher
Make sure when you run the Docker container, that you pass the
-p option with
8080:8080 as the argument, or else Docker will not bind the exposed container port to your computer's interface.
See the docs here: https://docs.docker.com/engine/reference/run/#expose-incoming-ports
Yash Gopal4,638 Points
Make sure no other containers are using the same ports? Maybe try stopping all containers and re-running those commands from within the directory that you have the dockerfile / project in.
localhost doesn't work if you are using
docker-toolbox on Windows because it has to use Virtualbox. You'll need to use the IP address of the virtual machine
docker creates, which is
192.168.99.1. So you would connect using