I've installed docker on my windows (10), and when I try to build a new project, I always get the following error:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
When i check the project i created in visual studio 2017, i don't see docker-compose section in solution. It just has one project (.Net core 2.0) and one Dockerfile file in it.
Following are the steps i followed.
File-> new Project -> Asp.Net core web application -> API (Enable Docker Support) -> OK
and this is how my project structure looks like (no docker-compose section in it)
Am i missing anything here ?
The default path for a Compose file is ./docker-compose.yml .
The key difference between docker run versus docker-compose is that docker run is entirely command line based, while docker-compose reads configuration data from a YAML file. The second major difference is that docker run can only start one container at a time, while docker-compose will configure and run multiple.
Not really an expert on VS 2017, but you would need to create a docker-compose.yml
file inside of the project.
More information can be found here.
version: '3.5'
services:
client:
container_name: WebApplication
build:
dockerfile: Dockerfile
volumes:
# Any volumes you would mount goes here
ports:
# Ports that need to be mapped from container to host goes here
environment:
# Any environment variables
Edit: In order for VS 2017 to automatically create docker-compose.yml
, you will need to right-click on the Project and select Add > Orchestrator Support (15.8 and greater) or Add > Docker Project Support (below 15.8).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With