mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #2139] Automatically pre-start a Docker service inside the workflow containers #1020
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#1020
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 @whisperity on GitHub (Dec 27, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/2139
Act version
act version 0.2.56
Feature description
I am looking for an easy way (preferably without modifying my
workflow.yaml) to automatically start a Docker daemon inside the running workflow container (i.e., within what is spawned byact). I am using-P ubuntu-22.04=catthehacker/ubuntu:act-22.04, bothactand the underlying image freshly pulled:The problem is that letting
actmount the host Docker socket and thus running a Docker container configured by the workflow on the host's Docker environment results in that container's side effect being put to a wrong location.I have the following workflow, which I heavily simplified for the sake of exposition:
Here, I have a Docker container executed on a separately cloned repository which, amongst some other actions, creates some resources in a directory that must be available for later steps to work properly.
This works without any problems on the "real" GitHub Actions SaaS runners.
However, with
act, it does not. Assume that I have my local repository in<host>//home/whisperity/proj. If I doacthere, the Docker container created byactwill have its own<docker-1>//home/whisperity/proj, where the side project is also cloned:<docker-1>//home/whisperity/proj/Resources.However, when the reusable inner action spawns another Docker container,
<docker-2>, it will do so through the host's socket. In there,<docker-2>//home/whisperity/proj(the working directory) is the same as<host>//home/whisperity/proj, but this inner action fails, as the checkout of the side repository did not happen to this location, failing the entire workflow. The "Resources" directory is only present in<docker-1>//.Specifying
--container-daemon-socket "-"will just result in thedockerbinary complaining there is no Docker service running within the container. Rightfully so.My request is to have a way to automatically start a Docker daemon inside the containers that are running through
act. Preferably, without having to touch the workflow file! This whole idea might be related to services (#173), but having control over a Docker daemon not attached to the main host is sort of like a "meta service". I see two ways forward for this:actand the client images, which will spawn Docker if the user requests it when runningact. Or something like--container-daemon-socket "spawn"?