DEV-1229 Switch to ansible-builder v3
parent
2ea8479002
commit
0698aaf234
@ -1,4 +1,5 @@
|
||||
python38-devel [platform:rpm compile]
|
||||
git-core [platform:rpm]
|
||||
subversion [platform:rpm]
|
||||
subversion [platform:dpkg]
|
||||
git-lfs [platform:rpm]
|
||||
epel-release [platform:rpm]
|
||||
|
||||
@ -1 +1,2 @@
|
||||
/_build/
|
||||
Dockerfile
|
||||
@ -1,45 +0,0 @@
|
||||
ARG EE_BASE_IMAGE=quay.io/ansible/ansible-runner:stable-2.12-latest
|
||||
ARG EE_BUILDER_IMAGE=quay.io/ansible/ansible-builder:latest
|
||||
|
||||
FROM $EE_BASE_IMAGE as galaxy
|
||||
ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
|
||||
USER root
|
||||
|
||||
RUN mkdir -p /root/.ssh
|
||||
ADD ansible-builder/context/id_ed25519 /root/.ssh/id_ed25519
|
||||
RUN chmod -R 700 /root/.ssh
|
||||
|
||||
|
||||
RUN mkdir /build
|
||||
WORKDIR /build
|
||||
ADD galaxy-requirements.yml requirements.yml
|
||||
ADD pip-requirements requirements.txt
|
||||
ADD ansible-builder/bindep.txt bindep.txt
|
||||
|
||||
RUN ssh-keyscan git.dev-at.de >> /root/.ssh/known_hosts
|
||||
RUN eval $(ssh-agent) && ssh-add /root/.ssh/id_ed25519 && 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 --server https://old-galaxy.ansible.com
|
||||
|
||||
FROM $EE_BUILDER_IMAGE as builder
|
||||
|
||||
COPY --from=galaxy /usr/share/ansible /usr/share/ansible
|
||||
|
||||
ADD pip-requirements requirements.txt
|
||||
ADD ansible-builder/bindep.txt bindep.txt
|
||||
RUN ansible-builder introspect --sanitize --user-pip=requirements.txt --user-bindep=bindep.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt
|
||||
RUN assemble
|
||||
|
||||
FROM $EE_BASE_IMAGE
|
||||
USER root
|
||||
|
||||
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=quay.io/project-receptor/receptor:0.9.7 /usr/bin/receptor /usr/bin/receptor
|
||||
RUN mkdir -p /var/run/receptor
|
||||
ADD ansible-builder/context/run.sh /run.sh
|
||||
CMD /run.sh
|
||||
USER 1000
|
||||
RUN git lfs install
|
||||
@ -1,2 +0,0 @@
|
||||
#! /bin/bash
|
||||
ansible-runner worker --private-data-dir=/runner
|
||||
@ -1,16 +1,44 @@
|
||||
---
|
||||
version: 1
|
||||
version: 3
|
||||
|
||||
build_arg_defaults:
|
||||
ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: "--pre"
|
||||
|
||||
dependencies:
|
||||
ansible_core:
|
||||
package_pip: ansible-core~=2.12
|
||||
ansible_runner:
|
||||
package_pip: ansible-runner
|
||||
galaxy: ../galaxy-requirements.yml
|
||||
python: ../pip-requirements
|
||||
python_interpreter:
|
||||
package_system: "python311"
|
||||
python_path: "/usr/bin/python3.11"
|
||||
system: bindep.txt
|
||||
|
||||
images:
|
||||
base_image:
|
||||
name: quay.io/centos/centos:stream9-minimal
|
||||
|
||||
additional_build_files:
|
||||
- src: ../ansible.cfg
|
||||
dest: configs
|
||||
|
||||
options:
|
||||
package_manager_path: /usr/bin/microdnf
|
||||
|
||||
additional_build_steps:
|
||||
append:
|
||||
- RUN alternatives --set python /usr/bin/python3
|
||||
- COPY --from=quay.io/project-receptor/receptor:0.9.7 /usr/bin/receptor /usr/bin/receptor
|
||||
append_base:
|
||||
- RUN $PYCMD -m pip install -U pip
|
||||
prepend_galaxy:
|
||||
- ADD _build/configs/ansible.cfg ~/.ansible.cfg
|
||||
- RUN microdnf install -y git-lfs openssh-clients
|
||||
- RUN mkdir -p /root/.ssh
|
||||
- ADD id_ed25519 /root/.ssh/id_ed25519
|
||||
- RUN chmod -R 700 /root/.ssh
|
||||
- RUN ssh-keyscan git.dev-at.de >> /root/.ssh/known_hosts
|
||||
- RUN eval $(ssh-agent) && ssh-add /root/.ssh/id_ed25519
|
||||
append_final:
|
||||
- COPY --from=quay.io/ansible/receptor:devel /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
|
||||
- RUN git lfs install --system
|
||||
|
||||
Loading…
Reference in New Issue