Skip to content

Commit

Permalink
chore: optionally allow to use a separate collection repo
Browse files Browse the repository at this point in the history
When developing new features which involves using newer collection
we need access to the collection in the image. When doing a developer
build of an image provide a build arg for the name of repo

e.g.
```
podman build --build-arg DEVEL_COLLECTION_LIBRARY=1 --build-arg DEVEL_COLLECTION_REPO=git+https://github.com/mkanoor/event-driven-ansible.git,pg_listener -t localhost/ansible-rulebook:latest .
```
  • Loading branch information
mkanoor committed Nov 21, 2023
1 parent f12f82c commit c9e9b85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM registry.access.redhat.com/ubi8/python-39

ARG USER_ID=${USER_ID:-1001}
ARG DEVEL_COLLECTION_LIBRARY=0
ARG DEVEL_COLLECTION_REPO=git+https://github.com/ansible/event-driven-ansible.git
WORKDIR $HOME

USER 0
Expand All @@ -19,7 +20,7 @@ RUN pip install -U pip \
&& ansible-galaxy collection install ansible.eda

RUN bash -c "if [ $DEVEL_COLLECTION_LIBRARY -ne 0 ]; then \
ansible-galaxy collection install git+https://github.com/ansible/event-driven-ansible.git --force; fi"
ansible-galaxy collection install ${DEVEL_COLLECTION_REPO} --force; fi"

COPY . $WORKDIR
RUN chown -R $USER_ID ./
Expand Down

0 comments on commit c9e9b85

Please sign in to comment.