mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[GH-ISSUE #2691] Stop services on job exit #1214
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#1214
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 @EDM115 on GitHub (Mar 6, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2691
Act version
act version 0.2.75
Feature description
When a job contains a
servicesfield, the relative containers should be stopped when the job exits (successfully or not), for example to free ports for further job services.As it could be a breaking change, maybe keep it behind a flag, like
--stop-services@ChristopherHX commented on GitHub (Mar 6, 2025):
--rm?@EDM115 commented on GitHub (Mar 7, 2025):
not exactly, as what
--rmdoes is "automatically remove container(s)/volume(s) after a workflow(s) failure"the thing is, i'd like them to be stopped (not removed) once the job is over. example workflow :
in this scenario, i'd like the 2 services containers of the
testssteps to be stopped once the job finishes, so we can create new ones on thedockerstep, and free the 5433 and 5434 ports on the host@EDM115 commented on GitHub (Mar 7, 2025):
also
--rmwon't do anything if thetestsjob succeeds, which as you might guess is problematic for thedockerstep afterwards 😄@ChristopherHX commented on GitHub (Mar 8, 2025):
Did you found a bug that containers are still existing on job success? if job succeeds removal of containers is the default.
--rmjust means do it for failed jobs as well.I am not working on enhancement requests for act right now, someone else could do this
@EDM115 commented on GitHub (Mar 10, 2025):
only services containers stayed up and running after a job success for whatever reason
@EDM115 commented on GitHub (Mar 10, 2025):
also as you can see, even with the
--rmflag and the job failing, the images are still up and running :(@EDM115 commented on GitHub (Mar 10, 2025):
Workflow
Command ran :
act --rm --container-options "--group-add 0" -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 workflow_dispatch@EDM115 commented on GitHub (Mar 10, 2025):
added details : any Docker container that has been ran (either through the services tag or manually as a command) will stay up and running after a job failure
@EDM115 commented on GitHub (Mar 12, 2025):
edit : it seemed like a skill issue on my end