When I run docker-compose up
, I am getting following error.
ERROR: Cannot locate specified Dockerfile: Dockerfile
Here is my compose file content:
version: '3'
services:
web:
build: .
ports:
- "5000:5000"
redis:
image: "redis:alpine"
2
Answers
The “build .” directive is looking for the default Dockerfile in your current directory but it cannot find it. If you are just trying to run redis you shouldn’t need to build from a Dockerfile.
Dockerfile
in same dirMake sure file named
Dockerfile
is kept in the same directory.Dockerfile
is in different folder.If you are keeping it in some other place, use
context
My
Dockerfile
name is different.If you wish to keep
Dockerfile
name different, then use