You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.
When trying to build and push my container project to my registry, and using a dockerized CI/CI container that runs ansible-container (Gitlab CI), I am using named volumes to mount the ansible-container config (container.yml and the roles directory). My build system will launch a container with a named volume (ansible-container-build-source) attached and mounted to a directory (and will have docker.sock bind mounted from the host as well), check out the source code, copy the code to that directory, install ansible-container and then run the command ansible-container build --src-mount-path ansible-container-build-source. This seems to work as --src-mount-path will interpret this properly as a named container and mount the ansible-container-build-source volume to /src inside the conductor, which will let it find the roles and continue the build. Without mounting this volume, ansible will not be able to find the roles dir as it attempts to bind-mount the working directory, which, in the docker-in-docker case, will try to bind mount a directory on the host instead of a directory in the container.
However, in the next build step, when I try to perform an ansible-container push --push-to myregistry it will fail with an error saying it cannot find the roles. If I try to include the --src-mount-path directory, it will error as that is not a valid option for push.
I've tried to use the --with volume option but this apparently cannot mount named volumes (it treats the first string in the src:dest:mode format as a path always, which it can also refer to a named volume). This might be another bug.
STEPS TO REPRODUCE
1. Create a named volume on host system with docker volume ansible-container-build-src
2. Launch a new container which maps the above volume to /buildsrc
3. Install ansible-container in this container and check out your source code
4. Copy your source code to /buildsrc
5. Run ansible-container build --src-mount-path ansible-container-build-src
6. Run ansible-container push --push-to myregistry (will fail on not able to find roles)
7. Run ansible-container push --src-mount-path ansible-container-build-src --push-to myregistry (will fail on invalid option)
EXPECTED RESULTS
Either ansible-container push to work on its own (not sure why a push command needs to re-read the roles when they were used only in build) or for it to also respect the --src-mount-path flag if it does need access to the src and roles dir.
ACTUAL RESULTS
See above repro steps for unexpected results
The text was updated successfully, but these errors were encountered:
I believe push needs access to the roles in order to ensure that there are fully baked images available to be pushed, and deploy also needs to transpile container.yml (including meta/container.yml for roles) into docker-compose.yml for injection into the generated playbook.
ISSUE TYPE
container.yml
OS / ENVIRONMENT
SUMMARY
When trying to build and push my container project to my registry, and using a dockerized CI/CI container that runs ansible-container (Gitlab CI), I am using named volumes to mount the ansible-container config (container.yml and the roles directory). My build system will launch a container with a named volume (
ansible-container-build-source
) attached and mounted to a directory (and will havedocker.sock
bind mounted from the host as well), check out the source code, copy the code to that directory, install ansible-container and then run the commandansible-container build --src-mount-path ansible-container-build-source
. This seems to work as--src-mount-path
will interpret this properly as a named container and mount theansible-container-build-source
volume to/src
inside the conductor, which will let it find the roles and continue the build. Without mounting this volume, ansible will not be able to find the roles dir as it attempts to bind-mount the working directory, which, in the docker-in-docker case, will try to bind mount a directory on the host instead of a directory in the container.However, in the next build step, when I try to perform an
ansible-container push --push-to myregistry
it will fail with an error saying it cannot find the roles. If I try to include the--src-mount-path
directory, it will error as that is not a valid option forpush
.I've tried to use the
--with volume
option but this apparently cannot mount named volumes (it treats the first string in thesrc:dest:mode
format as a path always, which it can also refer to a named volume). This might be another bug.STEPS TO REPRODUCE
EXPECTED RESULTS
Either
ansible-container push
to work on its own (not sure why a push command needs to re-read the roles when they were used only in build) or for it to also respect the--src-mount-path
flag if it does need access to the src and roles dir.ACTUAL RESULTS
See above repro steps for unexpected results
The text was updated successfully, but these errors were encountered: