Bind a specific directory of my host machine inside docker, not just the current directory (--bind)
Act version
act version 0.2.35
Feature description
Using --bind we 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.
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.
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.
Confirmed this works, doing something similar with .azure dir.
Has anyone gotten this to work in .actrc? I've tried changing line order, with and without =, nothing seems to apply --container-options correctly.
actrc follows a different syntax, quotes are forbidden, multiple flags in a line are forbidden
Should be similar to this, not tested by me.
--container-options -v ~/myproj:/home/user/projects/myproj/
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
Thanks, that works! Also with multiple volumes.