Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support purge for Docker::Run #689

Open
jcrsilva opened this issue May 24, 2017 · 4 comments
Open

Support purge for Docker::Run #689

jcrsilva opened this issue May 24, 2017 · 4 comments

Comments

@jcrsilva
Copy link

Feature request:

It would be nice if we had the option (in the main class configurations) to allow for purging of unmanaged containers and services

Right now if we remove a 'docker run' from the code, the container just keeps living in the machine forever

@gdubicki
Copy link

There is (undocumented though) option to delete the container after running for docker::run here https://github.com/garethr/garethr-docker/blob/master/manifests/run.pp#L107 .

@jcrsilva
Copy link
Author

@gdubicki issue is with the service files installed under systemd/init. If you remove a docker::run, those files are still in the system, and so the init system keeps bringing the containers up

@gdubicki
Copy link

Oh, ok. Then there is another undocumented :), but standard, parameter - ensure - which you can use to delete the service. See the code: https://github.com/garethr/garethr-docker/blob/master/manifests/run.pp#L306

@gdubicki
Copy link

Example:

docker::run { 'helloworld':
  ensure  => absent,
  image   => 'base',
  command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
}

cegeka-jenkins pushed a commit to cegeka/puppet-docker that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants