Closed marcusianlevine closed 7 years ago
I was able to work around this issue, but I'm going to leave it open because it does seem that the conductor should share the top-level volumes namespace
Am I missing something? Is there a reason the conductor can't mount volumes defined in the top-level volumes directive?
Same issue here when building a maven project I use the maven docker container that creates a volume at /root/.m2 which I mount to a toplevel volume.
The idea is to reuse the same maven cache in /root/.m2 for future builds of the same project. However, I get new empty volume each build and have to redownload all maven depedencies during the build...
Ansible Container doesn't create the top-level volumes. When it runs the conductor container, it builds up a docker run
command, and hands it off to the docker python module. I believe in the end the docker daemon creates the volume, and handles the volume's state between container runs, restarts, etc.
I've run into the same problem, where on subsequent runs of the build
command the named volume contains no data from the prior run. My fix has been to use a host volume, where a local file system path is mounted to the conductor.
@chouseknecht Well, from my test I have seen that this (At least for my particular case) is fixed in #576.
It appears that since the volumes were not being mounted during the build, if you build twice, (in my case for example) you will have an empty /root/.m2 each time. And also on the initial run.
After the fix above, the first build will create a named docker volume that will be reused each time this volume is needed (in build and run) until I remove it myself by hand.
@fish22 is right, my original issue is resolved by #576 as well, since I can just use a shared volume to transfer files instead of a conductor temp volume
ISSUE TYPE
container.yml
OS / ENVIRONMENT
SUMMARY
I am trying to write a container.yml that can be used to on a Jenkins CI server to build many iterations of the same project in parallel for a multibranch pipeline.
I'm running into a bunch of issues associated with running
ansible-container build
within many build processes on the same Docker host, the latest of which is the temp volume not having a unique name per run.I tried to solve this using the top-level volumes directive to create the
temp-space
volume before mounting to the conductor, but it seems that the conductor creates its own separatetemp-space
volume without the project name prepended as is done by thevolumes
TLDSTEPS TO REPRODUCE
EXPECTED RESULTS
With the introduction of the
volumes
top-level directory, I would expect the conductor to reference the same project-scoped volumes that are created by the TLDACTUAL RESULTS
I find that the conductor creates its own
temp-space
volume with just the literal name, even though I definedtemp-space
in thevolumes
TLDI tried to work around this with environment-provided container.yml variables, but it seems that volume names in the
conductor
section do not access global variables