Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ansible collection docker image #61

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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