From 8e0a7a90a22cef7ddfd195d09314867a17a194df Mon Sep 17 00:00:00 2001 From: Jon Ervine Date: Wed, 19 May 2021 22:05:06 +0800 Subject: [PATCH] Added user --- Containerfile | 16 ++-------------- Containerfile.1 => Containerfile.orig | 14 +++++++++++++- 2 files changed, 15 insertions(+), 15 deletions(-) rename Containerfile.1 => Containerfile.orig (52%) diff --git a/Containerfile b/Containerfile index 81b787e..a91b498 100644 --- a/Containerfile +++ b/Containerfile @@ -1,6 +1,5 @@ -ARG ANSIBLE_RUNNER_IMAGE=quay.io/ansible/ansible-runner:devel +ARG ANSIBLE_RUNNER_IMAGE=quay.io/ansible/awx-ee:0.2.0 ARG PYTHON_BUILDER_IMAGE=quay.io/ansible/python-builder:latest -ARG ANSIBLE_RECEPTOR_IMAGE=quay.io/project-receptor/receptor:0.9.7 FROM $ANSIBLE_RUNNER_IMAGE as galaxy @@ -11,22 +10,11 @@ WORKDIR /build RUN ansible-galaxy role install -r requirements.yml --roles-path /usr/share/ansible/roles RUN ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path /usr/share/ansible/collections -FROM $PYTHON_BUILDER_IMAGE as builder -ADD _build/requirements_combined.txt /tmp/src/requirements.txt -ADD _build/bindep_combined.txt /tmp/src/bindep.txt -RUN assemble - -FROM $ANSIBLE_RECEPTOR_IMAGE as receptor FROM $ANSIBLE_RUNNER_IMAGE COPY --from=galaxy /usr/share/ansible /usr/share/ansible -COPY --from=builder /output/ /output/ -RUN /output/install-from-bindep && rm -rf /output/wheels -RUN alternatives --set python /usr/bin/python3 -COPY --from=receptor /usr/bin/receptor /usr/bin/receptor -RUN mkdir -p /var/run/receptor -ADD run.sh /run.sh +RUN alternatives --set python /usr/bin/python3 && useradd -c "Ansible User" -M -u 1000 ansible CMD /run.sh USER 1000 RUN git lfs install diff --git a/Containerfile.1 b/Containerfile.orig similarity index 52% rename from Containerfile.1 rename to Containerfile.orig index 998498e..81b787e 100644 --- a/Containerfile.1 +++ b/Containerfile.orig @@ -1,5 +1,6 @@ -ARG ANSIBLE_RUNNER_IMAGE=quay.io/ansible/awx-ee:0.2.0 +ARG ANSIBLE_RUNNER_IMAGE=quay.io/ansible/ansible-runner:devel ARG PYTHON_BUILDER_IMAGE=quay.io/ansible/python-builder:latest +ARG ANSIBLE_RECEPTOR_IMAGE=quay.io/project-receptor/receptor:0.9.7 FROM $ANSIBLE_RUNNER_IMAGE as galaxy @@ -10,11 +11,22 @@ WORKDIR /build RUN ansible-galaxy role install -r requirements.yml --roles-path /usr/share/ansible/roles RUN ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path /usr/share/ansible/collections +FROM $PYTHON_BUILDER_IMAGE as builder +ADD _build/requirements_combined.txt /tmp/src/requirements.txt +ADD _build/bindep_combined.txt /tmp/src/bindep.txt +RUN assemble + +FROM $ANSIBLE_RECEPTOR_IMAGE as receptor FROM $ANSIBLE_RUNNER_IMAGE COPY --from=galaxy /usr/share/ansible /usr/share/ansible +COPY --from=builder /output/ /output/ +RUN /output/install-from-bindep && rm -rf /output/wheels RUN alternatives --set python /usr/bin/python3 +COPY --from=receptor /usr/bin/receptor /usr/bin/receptor +RUN mkdir -p /var/run/receptor +ADD run.sh /run.sh CMD /run.sh USER 1000 RUN git lfs install