maathor
maathor

Reputation: 131

Docker build "path . not found"

I'm trying to make my first docker container

I installed dokcer-ce, following docker tutorial for ubuntu.

I create a folder and put my Dockerfile in it.

FROM docker/whalesay

RUN apt-get update && apt-get install -y figlet fortune && rm /var/apt/*

CMD figlet "Hy SUPINFO" | cowsay -n && /usr/games/fortune -a | cowsay

In this folder I made a :

sudo docker build -t whalesupinfo .

I always have this output

unable to prepare context: path "." not found

EDIT: I was in sshd, not working into it ?!

Upvotes: 1

Views: 21438

Answers (2)

Ravi Pandit
Ravi Pandit

Reputation: 1

sudo docker build -t whalesupinfo . specify the dockerfile path sudo docker build -t /Your /dockerfile/ path/ -t whalesupinfo .

Upvotes: -1

Matt Walther
Matt Walther

Reputation: 403

Double check that the Dockerfile is spelled correctly on disk, and that when you run docker build, that the Dockerfile is in the same directory that you're in.

If that still doesn't work, tell docker exactly where the Dockerfile is with the -f argument.

docker build -t whalesupinfo -f /path/to/Dockerfile .

I would also try running docker without sudo.

Upvotes: 7

Related Questions