IIUC this is not a Jenkins issue but a Docker one. You should apparently look at volumes (create a named volume and share it between containers, don't use bind mounts/the host fs directly).
Also, don't know mongo, but are you really directly accessing the db data?! Shouldn't you through a socket or so? Then it's not even volume you want but network. HTH Le 24 nov. 2016 2:57 PM, "'Peter Teichner' via Jenkins Users" < [email protected]> a écrit : Hi! Thanks for coming back to me: My difficulty comes from the complexity of the different software components. So for example I have the application container that needs to talk to the mongo container. And the reason I used bind mount is so the maven image can resolve the application by it's host name. So in my maven container I bind mount my cucumber folder and the configuration for the host names are readily fixed to abc-host or abc-mongo-host for the cucumber execution. I'm already running a jenkins agent on the docker host but when I try to do the bind mount inside of the jenkins agent I have permission problems. I get the feeling that I might be doing unstandard things but I'm not too sure what would be the correct way... On Wednesday, 23 November 2016 21:19:03 UTC, Baptiste Mathus wrote: > Ah bind-mounts... FWIW, as a general rule, bind-mounts should be avoided > as much as possible, though using them especially for local dev & CI usage > is indeed a pretty common hack (or for special things like TZ configuration > where you mount the host file [in ro]). > > Depending on how you're using your thing, you can choose different paths. > Either run an agent on that docker host, probably the simplest. > Or, you redesign your image to not require bind mounts. Like, for example, > you create an image from maven:3.3.9-jdk-8 that's able to Git clone & > execute the command you need directly (or you pass it as an argument, > anyway). > > 2016-11-21 11:25 GMT+01:00 'Peter Teichner' via Jenkins Users < > [email protected]>: > >> Hi All, >> >> I'm slightly unsure whether the topic is more suitable here or on Docker >> forums - anyway I decided to post it here. >> >> I have a pipeline whereby I have a job to build my Docker images using >> the Docker cloud plugin ( building 2-3 images at a time, application, db, >> proxy) >> In a separate job I used to run docker-compose which would start my >> containers and a separate container to run the test. In this setup I had my >> Jenkins master and Docker engine co-located on 1 server. >> >> version: '2' >> services: >> abc: >> image: abc >> hostname: abc >> links: >> - abc-mongo >> abc-mongo: >> image: abc-mongo >> hostname: abc-mongo >> tester: >> image: maven:3.3.9-jdk-8 >> hostname: tester >> links: >> - abc >> command: mvn -q -f /cucumber/pom.xml clean integration-test >> volumes: >> - /${PWD}/cucumber:/cucumber >> >> >> Following some consideration I've decided to move Docker to a different >> machine and now I've got this problem where mount the cucumber folder is >> impossible as the machine is not the same. >> >> Any suggestion on this in terms of best practices and solution? Thanks >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/jenkinsci-users/c6fbd512-3599-4f4c-9e05-3284b07b04df% >> 40googlegroups.com >> <https://groups.google.com/d/msgid/jenkinsci-users/c6fbd512-3599-4f4c-9e05-3284b07b04df%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/ msgid/jenkinsci-users/8e262b00-fd98-4b07-83a5-4155aa0cb816%40googlegroups. com <https://groups.google.com/d/msgid/jenkinsci-users/8e262b00-fd98-4b07-83a5-4155aa0cb816%40googlegroups.com?utm_medium=email&utm_source=footer> . For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS5DzYpfxRQ4AM5GeYtjuXYN%3Dn3QdVRpj2kJjp-NCfy9Rw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
