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 in Puppet by Liana
98 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 by Sirajul
• 31,180 points

Related Questions In Puppet

0 votes
1 answer
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 in Puppet by Sirajul
• 31,180 points
23 views
0 votes
0 answers

Docker with Puppet

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

Aug 13 in Puppet by Karan
• 3,770 points
19 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 in Puppet by Karan
• 3,770 points
26 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
• 56,900 points
189 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 in Puppet by Sirajul
• 31,180 points
25 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 in Puppet by Sirajul
• 31,180 points
13 views