From 31921971798a2589809569e69a8c9aee6a82c264 Mon Sep 17 00:00:00 2001 From: Chris Elder Date: Sat, 27 Apr 2024 17:00:41 -0400 Subject: [PATCH] Update ansible collection docker image - Update base image to ubi9 minimal - Upgrade golang to 1.21.9 - Upgrade Hyperledger Fabric to v2.5.7 - Add osnadmin binary Signed-off-by: Chris Elder --- Dockerfile | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index b917a4c..3246a15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,20 +3,20 @@ # # In the first stage, install the common dependencies, and then set up the standard user. -FROM registry.access.redhat.com/ubi8/ubi-minimal AS base -RUN microdnf install python39 shadow-utils git \ +FROM registry.access.redhat.com/ubi9/ubi-minimal AS base +RUN microdnf install -y python39 shadow-utils git \ && groupadd -g 7051 hlf-user \ && useradd -u 7051 -g hlf-user -G root -s /bin/bash hlf-user \ && chgrp -R root /home/hlf-user /etc/passwd \ && chmod -R g=u /home/hlf-user /etc/passwd \ - && microdnf remove shadow-utils \ - && microdnf clean all + && microdnf remove -y shadow-utils \ + && microdnf clean -y all # In the second stage, install all the development packages, install the Python dependencies, # and then install the Ansible collection. FROM base AS builder -RUN microdnf install gcc gzip python39-devel tar \ - && microdnf clean all +RUN microdnf install -y gcc gzip python-devel tar \ + && microdnf clean -y all USER hlf-user ENV PATH=/home/hlf-user/.local/bin:$PATH RUN pip3.9 install --user -U 'ansible' fabric-sdk-py python-pkcs11 'openshift' semantic_version jmespath \ @@ -35,25 +35,21 @@ RUN curl -sSL "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/ # In the third stage, build the Hyperledger Fabric binaries with HSM enabled (this is not the default). FROM base AS fabric -RUN microdnf install git make tar gzip which findutils gcc \ - && microdnf clean all +RUN microdnf install -y git make tar gzip which findutils gcc \ + && microdnf clean -y all RUN ARCH=$(uname -m) \ && if [ "${ARCH}" = "x86_64" ]; then ARCH=amd64; fi \ && if [ "${ARCH}" = "aarch64" ]; then ARCH=arm64; fi \ - && curl -sSL https://dl.google.com/go/go1.14.15.linux-${ARCH}.tar.gz | tar xzf - -C /usr/local + && curl -sSL https://go.dev/dl/go1.21.9.linux-${ARCH}.tar.gz | tar xzf - -C /usr/local ENV GOPATH=/go ENV PATH=/usr/local/go/bin:$PATH RUN mkdir -p /go/src/github.com/hyperledger \ && cd /go/src/github.com/hyperledger \ && git clone -n https://github.com/hyperledger/fabric.git \ && cd fabric \ - && git checkout v2.2.1 \ - # FAB-18175 - ignore expired signer certificates when submitting transactions. - && git remote add jyellick https://github.com/jyellick/fabric.git \ - && git fetch jyellick \ - && git format-patch --stdout -1 459fca8f6a62198b63e6705c83897b98d64ae478 msp/mspimplsetup.go | git apply - + && git checkout v2.5.7 RUN cd /go/src/github.com/hyperledger/fabric \ - && make configtxlator peer GO_TAGS=pkcs11 EXECUTABLES= + && make configtxlator osnadmin peer GO_TAGS=pkcs11 EXECUTABLES= # In the final stage, copy all the installed Python modules across from the second stage and the Hyperledger # Fabric binaries from the third stage.