Puppet Docker Using Docker-Compose with Puppet

0 votes

Does the puppetlabs/docker module that is available in the puppet forge also have inbuilt configurations to use docker-compose? Standalone docker required to install docker compose specifically to use it. Is it the same with Puppet+Docker Integration (ie.puppetlabs/docker module)?

Aug 14, 2019 in Puppet by Liana
3,445 views

1 answer to this question.

0 votes
  • Docker Compose describes a set of containers in YAML format and runs a command to build and run those containers.

  • Included in the docker module is the docker_compose type

  • This enables Puppet to run Compose and remediate any issues to ensure reality matches the model in your Compose file.

  • Before you use the docker_compose type, you must install the Docker Compose utility.

  • To install Docker Compose, add the following code to the manifest file:

class {'docker::compose':
  ensure => present,
  version => '1.9.0',
}
  • Set the version parameter to any version you need to install.

  • This is an example of a Compose file:

compose_test:
  image: ubuntu:14.04
  command: /bin/sh -c "while true; do echo hello world; sleep 1; done"
  • Specify the file resource to add a Compose file to the machine you have Puppet running on. 

  • To define a docker_compose resource pointing to the Compose file, add the following code to the manifest file:

docker_compose { 'test':
  compose_files => ['/tmp/docker-compose.yml'],
  ensure  => present,
}
  • Puppet automatically runs Compose, because the relevant Compose services aren't running. If required, include additional options such as enabling experimental features and scaling rules.

answered Aug 14, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
1 answer

Puppet in Docker: Configuring Puppet containers using Docker compose.

Using Docker compose you can define a set ...READ MORE

answered Aug 20, 2019 in Puppet by Sirajul
• 59,230 points
1,894 views
0 votes
1 answer

What's the need to integrate docker with puppet?

There are 3 core use cases for integrating docker with Puppet or with ...READ MORE

answered Aug 13, 2019 in Puppet by Sirajul
• 59,230 points
1,117 views
0 votes
0 answers

Docker with Puppet

I am using Puppet as a config ...READ MORE

Aug 13, 2019 in Puppet by Karan
• 19,610 points
925 views
0 votes
0 answers

How do i set up docker with puppet?

I want to use puppetlabs/docker module in ...READ MORE

Aug 13, 2019 in Puppet by Karan
• 19,610 points
2,632 views
+2 votes
1 answer
+2 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
• 58,020 points
2,739 views
0 votes
1 answer

Docker with Puppet: How do i run the following command "docker build -t ubuntu /tmp/ubuntu_image" using puppet code?

 Hey @Liana, Including the docker_dir parameter is equivalent to ...READ MORE

answered Aug 16, 2019 in Puppet by Sirajul
• 59,230 points
1,020 views
0 votes
1 answer

Docker with Puppet: Run a conatiner using a native volume

When using the volumes array with docker::run, the command on ...READ MORE

answered Aug 16, 2019 in Puppet by Sirajul
• 59,230 points
1,303 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