Replies: 2 comments 2 replies
-
The error message says, "unable to prepare context: path '/home/runner/work/github-actions-docker-compose-build-context-issue/github-actions-docker-compose-build-context-issue/nested/nested' not found." It seems like the build path is incorrect. Instead of using "nested" as the build context, it's trying to use "nested/nested," which doesn't exist and causes the failure. To fix this, we need to adjust the GitHub Actions workflow file. Specifically, we need to specify the correct build context in the workflow. Here's what we can do:
The updated part of the "test.yaml" file should look like this:
By specifying the correct working directory, the build context will be set to "nested," and the Docker Compose setup should run successfully without the "nested/nested" path issue. I hope this will help you! |
Beta Was this translation helpful? Give feedback.
-
OK I figured it out. The docker compose docs states that the build context is relative to the compose file, not cwd. It is still strange though why my previous config worked. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Body
The repo to reproduce this problem: https://github.com/ddadaal/github-actions-docker-compose-build-context-issue
This repo has the following structure:
where the
docker-compose.yaml
defines a service that uses a image built fromnested/Dockerfile
.We assume that
docker-compose.yaml
can only be used from the root directory of the repo, so thedocker-compose.yaml
is defined asSo the service can be started using
It works fine locally:
Then, the repo defines a workflow that calls exactly the command above (
docker compose -f nested/docker-compose.yaml up -d
), but it failed to run ( https://github.com/ddadaal/github-actions-docker-compose-build-context-issue/actions/runs/5667130914/job/15355241715 ).The error is
unable to prepare context: path "/home/runner/work/github-actions-docker-compose-build-context-issue/github-actions-docker-compose-build-context-issue/nested/nested" not found
. It seems the path build path is wrong. It should benested
but actually isnested/nested
.This bug only occurs starting from 2pm (+8 UTC) of 2023/7/26. It works fine before.
Beta Was this translation helpful? Give feedback.
All reactions