Reputation: 525
I have springrestapi project setup in my local with Dockerfile and docker-compose.yml file successfully running. Now I have added my api tests as part of this project inside the same repository by adding a new directory called in-memory-tests.
in-memory-tests directory has Dockerfile in it. This Dockerfile has commands to copy to image. when i run docker-compose.yml file. its giving below error.
[3/6] COPY testng.xml /app/:
[4/6] COPY reports/testreport.html /app/reports/:
failed to solve: failed to compute cache key: "/reports/testreport.html" not found: not found
2: [] 2https://github.com/aamirsuhailo1/SpringRestAPIsOnDocker/tree/testframework_addition
Upvotes: 1
Views: 908
Reputation: 525
Got resolved after adding context: ./in-memory-tests/ and removing dockerfile: in-memory-tests/Dockerfile
Upvotes: 1
Reputation: 1644
You didn't set a build context in docker-compose.yml > testserv1 > build
. If you provide a dockerfile property you must also set the context.
Alternatively you can just set the build property, to the directory that contains a Dockerfile
, in your case build: .
should suffice, as the docker-compose.yml
is in the same directory as the Dockerfile
.
Upvotes: 0