From ccd6e1ede20ac6190744ca14f6648b1da2115d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Fri, 23 Feb 2024 09:15:39 +0100 Subject: [PATCH] MM: add rust to the builder image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- .../templates/Dockerfile-builder-image | 8 ++++ .../mirrormanager/templates/buildconfig.yml | 40 ++++++++++++++++--- 2 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 roles/openshift-apps/mirrormanager/templates/Dockerfile-builder-image diff --git a/roles/openshift-apps/mirrormanager/templates/Dockerfile-builder-image b/roles/openshift-apps/mirrormanager/templates/Dockerfile-builder-image new file mode 100644 index 0000000000..a45bbae40f --- /dev/null +++ b/roles/openshift-apps/mirrormanager/templates/Dockerfile-builder-image @@ -0,0 +1,8 @@ +FROM quay.io/fedora/python-311:latest +LABEL \ + name="python-311-with-rust" \ + vendor="Fedora Infrastructure" \ + license="MIT" +USER root +RUN dnf install -y cargo +USER 1001 diff --git a/roles/openshift-apps/mirrormanager/templates/buildconfig.yml b/roles/openshift-apps/mirrormanager/templates/buildconfig.yml index 6c182783b6..7f276fc2b6 100644 --- a/roles/openshift-apps/mirrormanager/templates/buildconfig.yml +++ b/roles/openshift-apps/mirrormanager/templates/buildconfig.yml @@ -1,10 +1,42 @@ --- +# Build a derivative of the python-311 builder image with Rust added to it +apiVersion: build.openshift.io/v1 +kind: BuildConfig +metadata: + name: python-311-with-rust + labels: + app: mirrormanager + build: python-311-with-rust +spec: + runPolicy: Serial + source: + type: Dockerfile + dockerfile: |- + {{ load_file('Dockerfile-builder-image') | indent(6) }} + strategy: + type: Docker + dockerStrategy: + from: + kind: ImageStreamTag + # name: python:3.11 + # namespace: openshift + # OpenShift does not have Python 3.11 (yet), use our own ImageStream + name: python-311:latest + output: + to: + kind: ImageStreamTag + name: python-311-with-rust:latest + triggers: + - type: ImageChange + +--- +# Build MirrorManager apiVersion: build.openshift.io/v1 kind: BuildConfig metadata: name: mirrormanager2 labels: - app: mirrormanager2 + app: mirrormanager build: mm spec: runPolicy: Serial @@ -25,10 +57,8 @@ spec: sourceStrategy: from: kind: ImageStreamTag - # name: python:3.11 - # namespace: openshift - # OpenShift does not have Python 3.11 (yet), use our own ImageStream - name: python-311:latest + # Our own ImageStream with rust added to it + name: python-311-with-rust:latest output: to: kind: ImageStreamTag