mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #1548] Bind a specific directory of my host machine inside docker, not just the current directory (--bind) #778
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#778
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @intrd on GitHub (Jan 5, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1548
Act version
act version 0.2.35
Feature description
Using
--bindwe can bind the current working dir inside the docker, but I didn't find a way to stay in my working dir and mount a specific directory of my host machine inside a docker path, something like–name=myproj -d -v ~/myproj:/home/user/projects/myproj/docker command line syntax.Btw,
Is there any way to configure the docker command line through act?
or.. pre-configure a mount point on the used image?
Thank you guys.
@erikahansen commented on GitHub (Mar 18, 2023):
This would be quite useful, for instance if you want to mount
~/.aws/from host machine so we don't need an additional step in workflows to make it work locally, like here: https://github.com/nektos/act/issues/409#issuecomment-1069241315.@ChristopherHX commented on GitHub (Mar 18, 2023):
I think
--container-options "-v ~/myproj:/home/user/projects/myproj/"allows this.These are raw docker options.
The Docker commands you see in the log are not used to interact with docker. Act uses the docker api server not cli.
@n15831 commented on GitHub (Apr 25, 2023):
Confirmed this works, doing something similar with .azure dir.
@alexandervlpl commented on GitHub (Jul 30, 2025):
Has anyone gotten this to work in .actrc? I've tried changing line order, with and without
=, nothing seems to apply--container-optionscorrectly.@ChristopherHX commented on GitHub (Jul 30, 2025):
actrc follows a different syntax, quotes are forbidden, multiple flags in a line are forbidden
Should be similar to this, not tested by me.
Only
${ENV_NAME}is replaced in the value.If you use
container:specify the flags there, then the cli side is dropped.You may need to replace ~ by ${HOME} and if your path contains quotes then quote it
@alexandervlpl commented on GitHub (Jul 30, 2025):
Thanks, that works! Also with multiple volumes.