[GH-ISSUE #1994] Add a CLI option for specifying runner mounts (bind/volume/tmpfs) #955

Closed
opened 2026-03-01 21:47:43 +03:00 by kerem · 1 comment
Owner

Originally created by @jenseng on GitHub (Sep 8, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1994

Act version

0.2.50

Feature description

It would be nice to be able to specify mounts to be used by the runner containers. This would be separate from container job volumes, the idea here is this would solely be a local/CLI thing that would affect any container launched by act.

Something like:

act -P self-hosted=my-cool-image --mount "type=bind,source=~/.s3krits,target=/run/s3krits"

The scenario is I have some sensitive data (e.g. credential files) that I don't want to include in my custom images. I'm looking to achieve parity with my actual self-hosted GitHub runners where these credentials automatically injected. If I could specify a bind mount, I could make this data available in the runner container, which would allow me to use the exact same images as my self-hosted GitHub runners.

For my use case I mainly need bind mounts, but this could also be useful for other mount types (e.g. tmpfs, etc), so I just used the docker mount syntax in my example. I didn't see a way to achieve this currently, but do let me know if I'm missing something!

If this feature seems reasonable to you, I'm happy to take a stab at a PR, conceptually it feels fairly straightforward to plumb mount configuration down to the runner containers.

Originally created by @jenseng on GitHub (Sep 8, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1994 ### Act version 0.2.50 ### Feature description It would be nice to be able to specify mounts to be used by the runner containers. This would be separate from [container job volumes](https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container#mounting-volumes-in-a-container), the idea here is this would solely be a local/CLI thing that would affect any container launched by act. Something like: ``` act -P self-hosted=my-cool-image --mount "type=bind,source=~/.s3krits,target=/run/s3krits" ``` The scenario is I have some sensitive data (e.g. credential files) that I don't want to include in my custom images. I'm looking to achieve parity with my actual self-hosted GitHub runners where these credentials automatically injected. If I could specify a bind mount, I could make this data available in the runner container, which would allow me to use the exact same images as my self-hosted GitHub runners. For my use case I mainly need bind mounts, but this could also be useful for other mount types (e.g. tmpfs, etc), so I just used the docker mount syntax in my example. I didn't see a way to achieve this currently, but do let me know if I'm missing something! If this feature seems reasonable to you, I'm happy to take a stab at a PR, conceptually it feels fairly straightforward to plumb mount configuration down to the runner containers.
kerem 2026-03-01 21:47:43 +03:00
Author
Owner

@jenseng commented on GitHub (Sep 8, 2023):

Aha, looks like this can be done today with --container-options 🥳

act -P self-hosted=my-cool-image --container-options "--mount type=bind,source=~/.s3krits,target=/run/s3krits"
<!-- gh-comment-id:1712097803 --> @jenseng commented on GitHub (Sep 8, 2023): Aha, looks like this can be done today with [`--container-options`](https://github.com/nektos/act/pull/1462) 🥳 ``` act -P self-hosted=my-cool-image --container-options "--mount type=bind,source=~/.s3krits,target=/run/s3krits" ```
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#955
No description provided.