2

I want to run a docker-compose in my Jenkins pipeline. My docker-compose needs to the current workspace source code. Jenkins cannot mount the volumes. What is missing?

pipeline {
agent any
stages {
    stage('Test') {
        steps {
            sh 'docker-compose run php'
        }
    }
}

}

#docker-compose.yml
version: '3'
services:
  web:
   image: nginx
   volumes:
     - ./src:/var/www/html       
  php:
   image: php
   volumes:
     - ./src:/var/www/html
Jake He
  • 2,417
  • 3
  • 29
  • 41
  • Depending on your jenkins setup, you might be facing the same issue as https://stackoverflow.com/questions/49312100/docker-in-docker-volumes-not-working-full-of-files-in-1st-level-container-em – Ryan Dawson Aug 10 '18 at 08:53

0 Answers0