0

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 ?!

maathor
  • 121
  • 1
  • 3
  • 12
  • Have you checked if your case is something similar to [this](https://stackoverflow.com/questions/35511604/docker-unable-to-prepare-context-unable-to-evaluate-symlinks-in-dockerfile-pat)? – tgogos Dec 15 '17 at 10:58
  • check again that your `Dockerfile` really exists in the path you are running the command – Edwin Dec 15 '17 at 11:03
  • Please run `sudo -s`, then `pwd` and `ls -al`, and update your question with the full output of those. – BMitch Dec 15 '17 at 16:05

2 Answers2

5

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.

Matt Walther
  • 383
  • 5
  • 12
-1

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