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 in Puppet by Nizam
22 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 by Sirajul
• 39,540 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 in Puppet by Sirajul
• 39,540 points
35 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 in Puppet by Sirajul
• 39,540 points
24 views
0 votes
1 answer
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
• 56,940 points
232 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 in Puppet by Sirajul
• 39,540 points
29 views