Docker action in same repository with Dockerfile in root #26235
-
I want to run a docker action that I created in my own repository (the same as the workflow), its path, relative to the repository root would be /.github/actions/automatic-tests. I also have a Dockerfile in the root of the repository, which I use to create a docker image that runs the tests in my rails app. In the documentation it is said that _“To reference a Dockerfile local to your repository, use a path relative to the root of the repository” _and the example would be:
However, it seems that, when running the action, the Dockerfile is searched in the actions folder, not in the root of the repository. The error is as follows:
I cannot put the Dockerfile inside the actions folder as I need to COPY the whole app. The workaround would be to use git to clone the repo but I think this should not be the solution when working in the exact same repository… Can anyone tell me what I am doing wrong or what I should do to make it work? Thanks! Raquel |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I finally got it to work with:
So it seems the path is relative not to the repository but to the action root, I hope this helps someone! |
Beta Was this translation helpful? Give feedback.
-
This helped me, thanks @raquelhortab! I see that the documentation was recently updated so the copy for > Required for container actions The Docker image to use as the container to run the action. The value can be the Docker base image name, a local |
Beta Was this translation helpful? Give feedback.
I finally got it to work with:
So it seems the path is relative not to the repository but to the action root, I hope this helps someone!