Aded user
This commit is contained in:
parent
cb673b3df2
commit
2b438cf21c
@ -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
|
||||
|
||||
@ -7,14 +8,25 @@ ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
|
||||
ADD _build /build
|
||||
|
||||
WORKDIR /build
|
||||
RUN ansible-galaxy role install -r requirements.yml --roles-path /usr/share/ansible/roles
|
||||
RUN auseradd -c "Ansible User" -M -u 1000 ansible && 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 && useradd -c "Ansible User" -M -u 1000 ansible
|
||||
COPY --from=receptor /usr/bin/receptor /usr/bin/receptor
|
||||
RUN mkdir -p /var/run/receptor
|
||||
ADD run.sh /run.sh
|
||||
CMD /run.sh
|
||||
USER ansible
|
||||
RUN git lfs install
|
||||
|
||||
20
Containerfile.1
Normal file
20
Containerfile.1
Normal file
@ -0,0 +1,20 @@
|
||||
ARG ANSIBLE_RUNNER_IMAGE=quay.io/ansible/awx-ee:0.2.0
|
||||
ARG PYTHON_BUILDER_IMAGE=quay.io/ansible/python-builder:latest
|
||||
|
||||
FROM $ANSIBLE_RUNNER_IMAGE as galaxy
|
||||
|
||||
ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
|
||||
ADD _build /build
|
||||
|
||||
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 $ANSIBLE_RUNNER_IMAGE
|
||||
|
||||
COPY --from=galaxy /usr/share/ansible /usr/share/ansible
|
||||
|
||||
RUN alternatives --set python /usr/bin/python3 && useradd -c "Ansible User" -M -u 1000 ansible
|
||||
CMD /run.sh
|
||||
USER ansible
|
||||
RUN git lfs install
|
||||
@ -1,32 +0,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
|
||||
|
||||
ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
|
||||
ADD _build /build
|
||||
|
||||
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
|
||||
Loading…
Reference in New Issue
Block a user