Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Introduction to Docker Building Images Using Dockerfiles Building Images Using Dockerfiles

Thomas Le
Thomas Le
8,317 Points

Dockerfile link?

Hi! Unless I'm missing something, the dockerfile being used in the video wasn't linked in the teacher's notes! I'll just type it out for now since it's pretty short. Can someone update the links?

Thanks!

Steve Berrill
Steve Berrill
20,016 Points

Bump... yes the link i only see is to a full docker file on github which is very large.

1 Answer

Steve Berrill
Steve Berrill
20,016 Points

I had to type the docker file example out, here it is

# 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
Steve Berrill
Steve Berrill
20,016 Points

I also came across an issue where docker could not locte python3

"Unable to locate package python3"

so i had to change this command in the docker file so that they where joined with &&

from

# Commands to run to install dependencies
RUN apt-get update -y
RUN apt-get install -y python3

to

# Commands to run to install dependencies
RUN apt-get update && apt-get install -y python3