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 The ENTRYPOINT and CMD Instructions

surya D
seal-mask
.a{fill-rule:evenodd;}techdegree
surya D
Python Web Development Techdegree Student 158 Points

Docker build is not working

Hi i just wanted to build some sample Dockerfile in my linux system. following are the code and error i am getting. please help. Dockerfile: FROM ubuntu:latest CMD echo "Hello world"

Files in working directory: only Dockerfile command used : docker build -t hello Error: "docker build" requires exactly 1 argument(s). See 'docker build --help'. Usage: docker build [OPTIONS] PATH | URL | -

1 Answer

Tom Geraghty
Tom Geraghty
24,174 Points

You forgot to indicate the directory where the Dockerfile is located.

Change this:

docker build -t hello

to this:

docker build -t hello .

That little . will tell it to use the current working directory.