2

I read in certain docker plugins, such as docker-slave-plugin, it shows there is support for compose but I do not understand how to implement it.

Has anyone used docker-compose in the Jenkins pipeline and how?

scott
  • 241
  • 2
  • 10
  • edited to hopefully fix what the downvote was for – scott Feb 26 '18 at 22:44
  • why not use sh 'docker-compose ...' ? just make sure the docker-compose installed on the slave you are running – Mor Lajb Feb 27 '18 at 05:58
  • I should have mentioned I am using CoreOs and that does not have support for jenkins slave, there is no java and other things etc. the plugins use the remote API i understand so they don't need to have the coreos configured as a jenkins slave. – scott Feb 27 '18 at 18:15
  • So the jobs running on the master ? – Mor Lajb Feb 27 '18 at 19:05
  • I was expecting that the jenkinsfile would orchestrate the commands in it(eg. git checkout, scripts, etc) from the master onto the coreos host in the docker container... is that not how this plugin works?.. or does it need to have the ability to connect to CoreOs in the same way it connects to traditional slaves? – scott Feb 27 '18 at 19:22

2 Answers2

2

The short answer appears to be no. It does not directly support compose.

I got around this by using the script{} blocks in the Jenkinsfile to manually call docker-compose up which worked fine.

scott
  • 241
  • 2
  • 10
0

I installed docker and docker-compose on the Jenkins machine and run it with
sh 'docker-compose up' it is not a Jenkins plugin but it works.

Maoz Zadok
  • 4,871
  • 3
  • 33
  • 43