Development Tools Introduction to Docker Building Images Using Dockerfiles The ENTRYPOINT and CMD Instructions

Juliette Tworsey
Juliette Tworsey
Front 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 [""]

# Working directory

# Copy apps from the local folder to the Docker container

# Make port available


3 Answers

Jared Smith
Jared Smith
Treehouse Guest Teacher

Hi Juliette,

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:

Best, Jared

Juliette Tworsey
Juliette Tworsey
Front End Web Development Techdegree Graduate 32,403 Points

Hi Jared,

Thanks for getting back to me!

These are the commands that I am running from my home directory:

docker build -t sample-web-app:1.0 .

docker run -p 8080:8080 sample-web-app

Localhost is (still) refusing to connect and I'm not sure what to do to get it to start.

I had no problem starting a mongod instance (and mongo) from within Docker, but this one is eluding me.

Thanks in advance for any further clues:-)

Yash Gopal
Yash Gopal
4,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 So you would connect using