From 592a0e1b597886e4a0406da07a7349359b7e227b Mon Sep 17 00:00:00 2001 From: Augustine Abaris Date: Thu, 5 Sep 2024 16:44:17 -0400 Subject: [PATCH 1/3] Move galaxy role install from builder to final container --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 01fe762..fdf6aba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ COPY galaxy-requirements.yaml /srv/docker-ansible/galaxy-requirements.yaml RUN python3 -m venv /srv/docker-ansible/env && \ /srv/docker-ansible/env/bin/pip install -r /srv/docker-ansible/requirements.txt -RUN /srv/docker-ansible/env/bin/ansible-galaxy install -r /srv/docker-ansible/galaxy-requirements.yaml # Final Image @@ -34,6 +33,8 @@ COPY --from=builder /srv/docker-ansible /srv/docker-ansible COPY lint.sh /srv/docker-ansible/env/bin/lint.sh +RUN /srv/docker-ansible/env/bin/ansible-galaxy install -r /srv/docker-ansible/galaxy-requirements.yaml + ENTRYPOINT [] CMD ["/srv/docker-ansible/env/bin/ansible-playbook"] From 21c8bbd44cea7b940d5a3b286aff99fd5888463e Mon Sep 17 00:00:00 2001 From: Augustine Abaris Date: Thu, 5 Sep 2024 16:53:12 -0400 Subject: [PATCH 2/3] Move galaxy role install to it's own directory --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fdf6aba..5ed7417 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,8 @@ COPY galaxy-requirements.yaml /srv/docker-ansible/galaxy-requirements.yaml RUN python3 -m venv /srv/docker-ansible/env && \ /srv/docker-ansible/env/bin/pip install -r /srv/docker-ansible/requirements.txt +RUN /srv/docker-ansible/env/bin/ansible-galaxy install -p /srv/docker-ansible/galaxy-roles -r /srv/docker-ansible/galaxy-requirements.yaml + # Final Image FROM python:3.10-slim-bullseye @@ -33,8 +35,6 @@ COPY --from=builder /srv/docker-ansible /srv/docker-ansible COPY lint.sh /srv/docker-ansible/env/bin/lint.sh -RUN /srv/docker-ansible/env/bin/ansible-galaxy install -r /srv/docker-ansible/galaxy-requirements.yaml - ENTRYPOINT [] CMD ["/srv/docker-ansible/env/bin/ansible-playbook"] From 70b5f7207000ecafa60f0ac5f23ff87863ac2e54 Mon Sep 17 00:00:00 2001 From: Augustine Abaris Date: Fri, 6 Sep 2024 10:56:13 -0400 Subject: [PATCH 3/3] Move galaxy role back to default location --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ed7417..fdf6aba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,8 +17,6 @@ COPY galaxy-requirements.yaml /srv/docker-ansible/galaxy-requirements.yaml RUN python3 -m venv /srv/docker-ansible/env && \ /srv/docker-ansible/env/bin/pip install -r /srv/docker-ansible/requirements.txt -RUN /srv/docker-ansible/env/bin/ansible-galaxy install -p /srv/docker-ansible/galaxy-roles -r /srv/docker-ansible/galaxy-requirements.yaml - # Final Image FROM python:3.10-slim-bullseye @@ -35,6 +33,8 @@ COPY --from=builder /srv/docker-ansible /srv/docker-ansible COPY lint.sh /srv/docker-ansible/env/bin/lint.sh +RUN /srv/docker-ansible/env/bin/ansible-galaxy install -r /srv/docker-ansible/galaxy-requirements.yaml + ENTRYPOINT [] CMD ["/srv/docker-ansible/env/bin/ansible-playbook"]