Open dabrahams opened 11 months ago
Facing the same issue using act
and devcontainers/ci
.
The problem is that the mounted workspace in the devcontainers/ci
docker container is from the host file system.
act
is creating its own docker container with the workspace copied into its container's file system. devcontainers/ci
docker container is not created inside act
's container (no docker-in-docker), but besides it. Therefore devcontainers/ci
's workspace mount is not pointing to act
's workspace copy, but to the original workspace on the host file system.
This is why the devcontainer cannot start. Path /var/run/act/workflow/
exists in act
's container but not on your host system:
| [2023-11-17T09:14:55.111Z] Start: Run: docker run
...
--mount type=bind,src=/var/run/act/workflow/outputcmd.txt,dst=/mnt/github/output
...
| [2023-11-17T09:14:55.386Z] docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /var/run/act/workflow/outputcmd.txt.
This can be worked around by creating the files under /var/run/act/workflow/
on the host filesystem, so the devcontainer can start, BUT as the devcontainers/ci
step will work on a different file system from all the other steps in the job, running it with act
will be possibly pointless.
Not sure how act
should handle these kind of scenarios, but maybe if instead of copying the workspace into its container it could create a temporary copy of the workspace and the necessary files (like /var/run/act/workflow/
) on the host file system. Then could bind mount this copy into all of the containers created for the given job run and all the steps of the job would work on the same copied workspace on the host file system.
I've hit the same issue as @SyntaxSugarNet while trying to run devcontainers/ci
action with act
on WSL:
| [2024-06-18T16:01:17.833Z] docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /var/run/act/workflow/outputcmd.txt.
A workaround I found is to use custom a image that adds the dockerd daemon and then adding a step before devcontainer/ci to start docker-in-docker:
[...]
- name: optionally start DinD for act (local testing)
if: env.ACT
run: |
dockerd -H unix:///var/run/dind.sock & sleep 5;
echo "DOCKER_HOST=unix:///var/run/dind.sock" >>${GITHUB_ENV}
[....]
The command line: act -s GITHUB_TOKEN="$(gh auth token)" --container-options --privileged -P ubuntu-latest=ghcr.io/corvina-r-d/ubuntu:act-22.04
However it would be nice if docker-in-docker were a native options of act (act --dind
... )
Bug report info
Command used with act
Describe issue
Note that Docker IS in fact running
act fails on my local machine but the workflow succeeds in Github Linux CI
See attached act.log
Link to GitHub repository
https://github.com/dabrahams/SPMBuildToolSupport/actions/runs/6901849884
Workflow content
Relevant log output
Additional information
No response