For this to work, you'll need the host path to be the exact same as the
jenkins container path, i.e. not use /opt/jenkins but /var/jenkins_home on
host
so `pwd` will resolve to some /var/jenkins_home/... subfolder that make
sense to be mounted from host into your side container

2016-05-18 10:14 GMT+02:00 Nicolas Geraud <nicolas.ger...@gmail.com>:

> Hi all,
>
> i'm using a dockerized jenkins (from jenkinsci/jenkins:2.2) and mounting
> the following volumes from my host :
> volumes:
>         - "/opt/jenkins:/var/jenkins_home"
>         - "/var/run/docker.sock:/var/run/docker.sock"
>
>
> I've created a job that launch a docker container to build some python
> files :
> --Dockerfile
>
> FROM python:3-onbuild
> CMD [ "python" ]
>
>
> docker command of my jenkins job :
> $docker run --rm -v `pwd`:"/usr/src/myapp" graviteeio/python3 python
> src/main/python/package_bundles.py
>
> But the result is :
>
>
> Starting docker_package_bundle_and_publish_1
> Attaching to docker_package_bundle_and_publish_1
> [36mpackage_bundle_and_publish_1 | [0m python: can't open file './src/main
> /python/package_bundles.py': [Errno 2] No such file or directory
> [36mdocker_package_bundle_and_publish_1 exited with code 2
> [0mFinished: SUCCESS
>
>
> This is working fine on a classic jenkins, but not on a dockerized jenkins. 
> I've googled this error and it seems that mounting a volume inside a 
> container with an already mounting volume doesn't work.
>
> I think that some of you have already test the same use case so, how to do 
> that ?
>
> Thanks for any clue.
> I need to test a data volume instead of mounting a host volume.
>
>
> --
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/f847d41e-3b28-4b2b-b61e-ca0bf2927e5e%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/f847d41e-3b28-4b2b-b61e-ca0bf2927e5e%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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CANMVJzmsALEiNxFHqudZ6zsoMHpjW48UGkkR7AMwsBe5%2B%2BUvhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to