Skip to content

Commit

Permalink
Update ansible collection docker image
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
Chris Elder authored and MuthuSundaravadivel committed Apr 28, 2024
1 parent 6d934ce commit 2b8e661
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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.
Expand Down

0 comments on commit 2b8e661

Please sign in to comment.