Here is my docker-compose.yml
:
version: '2'
services:
web:
build: .
context: ./
dockerfile: Dockerfile
ports:
- "8080:8080"
container_name: demo
volumes:
- .:/images
I got an error:
ERROR: The Compose file './docker-compose.yml' is invalid because: Unsupported config option for services.web: 'dockerfile'
So I would like to build the container and also run. I will have a few more containers to build and run. Is it possible by docker-compose?
dockerfile
option? Since the error clearly says this shouldn't be therecontext:
ordockerfile:
here. If you kept them, they need to be indented one step more and you need to remove the context directory name from thebuild:
line.build: .
, orbuild: { context: . }
, but not both.