[GH-ISSUE #50] Add ability to ignore files #30

Closed
opened 2026-03-01 21:39:14 +03:00 by kerem · 6 comments
Owner

Originally created by @jclem on GitHub (Mar 18, 2019).
Original GitHub issue: https://github.com/nektos/act/issues/50

Currently, act will include the entire working directory in the container it builds (which does make sense in the context of a cloned repository, but not necessarily a local working copy).

For example, I may have dependencies built for my host operating system (MacOS), but they need to be rebuilt inside the container. This works fine in Actions in production because the dependencies aren't checked into the repository. However, I can't see a way of not sending them to the built container with act without rming them (which slows down local development on my host).

Perhaps there could be some sort of .ignore file that ignores files from the host, and also prevents those files from the container from being copied back to the host?

Originally created by @jclem on GitHub (Mar 18, 2019). Original GitHub issue: https://github.com/nektos/act/issues/50 Currently, `act` will include the entire working directory in the container it builds (which does make sense in the context of a cloned repository, but not necessarily a local working copy). For example, I may have dependencies built for my host operating system (MacOS), but they need to be rebuilt inside the container. This works fine in Actions in production because the dependencies aren't checked into the repository. However, I can't see a way of not sending them to the built container with `act` without `rm`ing them (which slows down local development on my host). Perhaps there could be some sort of `.ignore` file that ignores files from the host, and also prevents those files from the *container* from being copied back to the host?
Author
Owner

@cplee commented on GitHub (Mar 18, 2019):

@jclem can you add them to your .dockerignore file?

<!-- gh-comment-id:474145091 --> @cplee commented on GitHub (Mar 18, 2019): @jclem can you add them to your `.dockerignore` file?
Author
Owner

@jclem commented on GitHub (Mar 19, 2019):

I am pretty sure I've already tried that, and that they were built into the container, anyway. I will double-check.

<!-- gh-comment-id:474540898 --> @jclem commented on GitHub (Mar 19, 2019): I am pretty sure I've already tried that, and that they were built into the container, anyway. I will double-check.
Author
Owner

@muuvmuuv commented on GitHub (Mar 8, 2020):

Having the same trouble. .dockerignore looks like that:

*/.cache
.git
.github
.now
.pnpm-store
.vscode
docker
node_modules
public
reports
tests
*/.eslintcache
*/.stylelintcache
*/.DS_Store
<!-- gh-comment-id:596216503 --> @muuvmuuv commented on GitHub (Mar 8, 2020): Having the same trouble. `.dockerignore` looks like that: ``` */.cache .git .github .now .pnpm-store .vscode docker node_modules public reports tests */.eslintcache */.stylelintcache */.DS_Store ```
Author
Owner

@cplee commented on GitHub (Mar 8, 2020):

How does this sound? When copying files into the job container, ignore any path referenced in .gitignore files. Would that solve your issues @muuvmuuv & @jclem ?

<!-- gh-comment-id:596264097 --> @cplee commented on GitHub (Mar 8, 2020): How does this sound? When copying files into the job container, ignore any path referenced in `.gitignore` files. Would that solve your issues @muuvmuuv & @jclem ?
Author
Owner

@muuvmuuv commented on GitHub (Mar 9, 2020):

Of course but shouldn't the .dockerignore work OOTB? I mean, having both to ignore files would be the "icing on the cake", since both can be different.

<!-- gh-comment-id:596499812 --> @muuvmuuv commented on GitHub (Mar 9, 2020): Of course but shouldn't the `.dockerignore` work OOTB? I mean, having both to ignore files would be the "icing on the cake", since both can be different.
Author
Owner

@cplee commented on GitHub (Mar 9, 2020):

So .dockerignore is only helpful for the situations where we build an image for a local action of type docker and want to ignore things in the context of .github/workflows/...

In this case, we want to avoid passing other files that may be outside that context, for example node_modules.

<!-- gh-comment-id:596606539 --> @cplee commented on GitHub (Mar 9, 2020): So `.dockerignore` is only helpful for the situations where we build an image for a local action of type docker and want to ignore things in the context of `.github/workflows/...` In this case, we want to avoid passing other files that may be outside that context, for example `node_modules`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#30
No description provided.