Add support for Docker Engine installed in WSL2 in GitHub Local Actions
Act version
act version 0.2.79
Feature description
There is an option to point to the Docker Desktop in the GitHub Local Actions settings. On Linux I have installed Docker Engine (not Docker Desktop - this means I am using Docker in my machine under the Apache License).
I would like to use Docker Engine in WSL2 under Windows 11. There is a warning when installing Docker Engine from https://get.docker.io/ but it is fine to run Docker in WSL2 on Windows 11 in this manner. You can provide a path reference to the Docker binary from Windows to WSL2 using UNC path:
\\wsl.localhost\Ubuntu\usr\bin\docker
It would be great to be able to support this option.
I have found if you install and run VS Code from the WSL2 environment then the Docker Engine is detected.
act does not use the cli tool of docker.
Yes if you run act inside the wsl2 where the docker.sock unix socket can be found act knows how to use it.
act uses docker engine, while my docker engine is in WSL.
I tried to point docker engine to the one inside wsl, yet it is not working:
act --container-daemon-socket "\\wsl.localhost\Ubuntu\var\run\docker.sock"
"Couldn't get a valid docker connection: DOCKER_HOST was not set, couldn't be found in the usual locations, and the container daemon socket ('\\\\wsl.localhost\\Ubuntu\\var\\run\\docker.sock) is invalid"
how do you run VSCode from WSL? I installed VSCode inside WSL, but received this error when I ran it:
To use Visual Studio Code with the Windows Subsystem for Linux, please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the `code` command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N] y
To no longer see this prompt, start Visual Studio Code with the environment variable DONT_PROMPT_WSL_INSTALL defined.
You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument `--no-sandbox` and specify an alternate user data directory using the `--user-data-dir` argument.
I agree with this issue ticket for act/github local action to support docker engine in WSL
https://nektosact.com/usage/custom_engine.html