Is a Docker action required to have DockerFile in the root? #25195
-
Is it required to have the I’m creating my first action and was following the docs, which doesn’t explicitly state that this is required. Is that the case, as long as Also, perhaps more importantly, does the filename need to be case sensitive (i.e. If there is a better/different way to test the actions locally, that is in the same repo, I’d love to hear that too. I’m new to actions but couldn’t find this specific information or practices in some other OSS actions I’ve looked into to debug this. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
A Dockerfile is a text file that Docker reads in from top to bottom. It contains a bunch of instructions which informs Docker HOW the Docker image should get built. The Dockerfile is essentially the build instructions to build the image, you can say a Dockerfile is a recipe (or blueprint if that helps) for building Docker images. From the description of Dockerfile, I think a Dockerfile is required for a Docker action. And we generally use “Dockerfile” to name it, this is the most recommended name. In addition, if you setup the action in its own repository, when you wants to use this action the workflow, you also can directly use the syntax " uses: {owner}/{repo}@{ref}". For example “uses: vidavidorra/github-action-renovate@master” in your case. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. I probably wasn’t too clear about it in my initial message but I know how Docker works. Regardless, thanks for your clear explanation. I’ve tried a whole bunch of different options, but apparently the name of the Dockerfile cannot contain any upercase characters other that the first uppercase character. So “Dockerfile” and “dockerfile” are both fine but “DockerFile” isn’t. That seemed to have been the issue as I now have successfull build (example). I’ve also seen people use that, but that would only work for running the action on push of the master branch, and not for PRs.
I’m now using the following with my Dockerfile in a src directory. This should work for all branches and PRs as well.
|
Beta Was this translation helpful? Give feedback.
Thanks for the response. I probably wasn’t too clear about it in my initial message but I know how Docker works. Regardless, thanks for your clear explanation.
I’ve tried a whole bunch of different options, but apparently the name of the Dockerfile cannot contain any upercase characters other that the first uppercase character. So “Dockerfile” and “dockerfile” are both fine but “DockerFile” isn’t. That seemed to have been the issue as I now have successfull build (example).
I’ve also seen people use that, but that would only work for running the action on push of the master branch, and not for PRs.
I’m now using the following with my Docker…