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

surya D
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,148 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.