Last post Jun 06, 2018 07:03 AM by Edward Z
Jun 04, 2018 01:20 PM|Vanilson_Lourenco|LINK
I´m trying to implement microservices using this link https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/data-driven-crud-microservice but
I get an error in docker compose file (i´m new in docker). The error says: Service "" has neither an image nor a build context specified. At least one must be provided. I try to google the error but have no success.
Code of docker-compose.yml:
- ConnectionString=Server=sql.data;Database=db;User Id=id;Password=password
# Additional environment variables for this service
Jun 06, 2018 07:03 AM|Edward Z|LINK
For your issue, it is caused by that you did not specify the image nor build context for the second service “DockerExaple.api”.
Did you want to add docker support to DockerExaple.api? If so, you could configure the settings like the previous service “dockerExample”.
Your current configuration for “DockerExaple.api” is used in “docker-compose.override.yml” to override the connectionString. You should not set it in docker-compose.yml.
I think you could follow steps below to add docker support, it will generate the dockerfile and docker-compose.yml for you.
Right Click project-> Add-> Docker Support