Bug: action.yml runs.image is not used if Dockerfile is present

From the documentation of creating an action you can use a docker-image instead of a Dockerfilehttps://help.github.com/en/articles/metadata-syntax-for-github-actions#image

This works fine, and greatly increases the speed of workflows. But when a Dockerfile is present in the repository, the Dockerfile is used instead. 

The workaround seems to be to rename the Dockerfile.

Hi @judoole,

Thank you for being here, and apologies for the delay in response. We appreciate you taking the time to report this, are you still having the same issue?

No stress @andreagriffiths11 

The workaround does work, so there was no major worries. That thing has unfortunately been rewritten, so it’s a bit cumbersome to recreate for me again. More of a heads up to the dev-team or whomever else stumbles upon the same issue.

@judoole Thank you for reporting this bug.  We have fixed and the updated runner should now be out to all production. 

I apologize for the inconvenience. 

1 Like

@chrispat  This bug seems to have resurfaced:

Run ./folder/migrate
Dockerfile for action: '/home/runner/work/repo/repo/./folder/migrate/./action.Dockerfile'.
/usr/bin/docker build -t 10865d:ab069054696f58c6f8e0f3a99e770579 "/home/runner/work/repo/repo/folder/migrate"

Which then fails because it actually uses the Dockerfile in folder/migrate and not action.Dockerfile. Seems that the docker build command is incorrect.

@michaelbeaumont ,

The original issue was around the dockerfile being used when an image was specified if a dockerfile was present in the repo.

It sounds like you are seeing the wrong dockerfile is being used.

Could you provide a link to a run showcasing this issue or provide your action.yml runs section and the workflow showing how you invoke the action?

It looks like you are running a local action via 

uses: ./folder/migrate
name: "migrate"
  using: "docker"
  image: "./action.Dockerfile"

- uses: ./folder/migrate
        name: Handle migration

Indeed it’s a different situation but it seemed to me to be the same error, that runs.image is simply ignored.

In folder/migrate are Dockerfile and action.Dockerfile