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
1,512 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
• 59,190 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
• 59,190 points
1,716 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
• 59,190 points
1,387 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
• 59,190 points
1,503 views
+2 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
7,729 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
• 59,190 points
1,456 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP