Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 2
Message 1 of 2

Docker action in same repository with Dockerfile in root

Solved! Go to Solution.

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:

image: 'Dockerfile'

 

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:

/home/runner/work/_actions/raquelhortab/hello_world_github_actions/master/.github/actions/automatic-tests/Dockerfile: no such file or directory

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

1 Reply
Solution
Ground Controller Lvl 2
Message 2 of 2

Re: Docker action in same repository with Dockerfile in root

I finally got it to work with:

image: '../../../Dockerfile'

So it seems the path is relative not to the repository but to the action root, I hope this helps someone!