Docker with Puppet: How can i remove the associated volumes when a container stops?

0 votes
When i stop a service, the init scripts generated will stop the container but the volumes associated with the container are not removed. How do i change this behaviour?
Aug 16, 2019 in Puppet by Nizam
30 views

1 answer to this question.

0 votes

By default, when the service stops or starts, the generated init scripts remove the container, but not the associated volumes. 

To change this behaviour, add the following code to the manifest file:

docker::run { 'helloworld':
  remove_container_on_start => true,
  remove_volume_on_start    => false,
  remove_container_on_stop  => true,
  remove_volume_on_stop     => false,
}

This should do!

answered Aug 16, 2019 by Sirajul
• 44,350 points

Related Questions In Puppet

0 votes
1 answer
0 votes
1 answer

Puppet: How many slave nodes can i configure with a single puppet master?

Open source Puppet doesn't have any kind ...READ MORE

answered Aug 9, 2019 in Puppet by Sirajul
• 44,350 points
45 views
0 votes
1 answer

Puppet: How can i remove all the node entries that are no longer managed by puppet?

You could try this: class remove_unmanaged { ...READ MORE

answered Aug 9, 2019 in Puppet by Sirajul
• 44,350 points
30 views
0 votes
1 answer

Puppet+Docker: How do i configure my docker container to use a NFS volume?

docker_volume { 'nfs-volume': ensure => ...READ MORE

answered Aug 13, 2019 in Puppet by Sirajul
• 44,350 points
48 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,450 points
324 views
0 votes
1 answer

How can i know the time as to when exactly did a node join puppet?

Puppet does not itself keep any timestamp ...READ MORE

answered Aug 8, 2019 in Puppet by Sirajul
• 44,350 points
36 views