Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Close docker containers when Jenkins pipeline is killed #27

Closed
2 tasks
Kubuxu opened this issue Feb 2, 2017 · 5 comments
Closed
2 tasks

Close docker containers when Jenkins pipeline is killed #27

Kubuxu opened this issue Feb 2, 2017 · 5 comments

Comments

@Kubuxu
Copy link
Contributor

Kubuxu commented Feb 2, 2017

Acceptance Criteria

  • Starting a job that runs a long-lived docker container should kill the container if the job is cancelled

Tasks

  • Implement a way for killing all related docker containers when job is cancelled

Notes

Original post from @Kubuxu

It will proceed to run in backround and keep using resources.

@victorb
Copy link
Collaborator

victorb commented Feb 3, 2017

Hm, interesting. So "Pipeline is killed" is when you forcefully stops the job or is there an error happening?

@Kubuxu
Copy link
Contributor Author

Kubuxu commented Feb 3, 2017

When you stop a job via the UI. I think some combination of -t and -i flags is in play here.

@victorb
Copy link
Collaborator

victorb commented Feb 3, 2017

Ah, ok, I understand. So when you stop a pipeline, the docker container continuous to run, when it should be stopped together with the pipeline. Probably there is some hook in the Jenkinsfile we can use, on-end or something like that, where we can forcefully kill the containers involved in the pipeline.

@Kubuxu
Copy link
Contributor Author

Kubuxu commented Feb 3, 2017

Yeah, something like that. There is docker workflow plugin which might help.

@Kubuxu
Copy link
Contributor Author

Kubuxu commented Feb 10, 2017

Resolved by the docker workflow plugin. If you want to take a look how it works with more complex pipeline see go-ipfs Jenkinsfile.

@Kubuxu Kubuxu closed this as completed Feb 10, 2017
@Kubuxu Kubuxu removed the ready label Feb 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants