Added user

This commit is contained in:
Jon Ervine 2021-05-19 22:05:06 +08:00
parent 507197e45c
commit 8e0a7a90a2
2 changed files with 15 additions and 15 deletions

View File

@ -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

View File

@ -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