|
| 1 | +# |
| 2 | +# Copyright contributors to the Hyperledger Fabric Operations Console project |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | +# |
| 6 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +# you may not use this file except in compliance with the License. |
| 8 | +# You may obtain a copy of the License at: |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, software |
| 13 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +# See the License for the specific language governing permissions and |
| 16 | +# limitations under the License. |
| 17 | +# |
| 18 | +ARG ARCH |
| 19 | +ARG REGISTRY |
| 20 | +ARG GO_VER |
| 21 | + |
| 22 | +FROM registry.access.redhat.com/ubi9/ubi-minimal as builder |
| 23 | +COPY . /go/src/github.ibm.com/fabric/fabric-chaincode-builder |
| 24 | +WORKDIR /go/src/github.ibm.com/fabric/fabric-chaincode-builder |
| 25 | +RUN GOOS=linux GOARCH=$(go env GOARCH) go build -o build/fabric-chaincode-builder ./cmd/ibp-builder |
| 26 | + |
| 27 | +FROM registry.access.redhat.com/ubi9/ubi-minimal |
| 28 | +ARG IBP_VER |
| 29 | +ARG BUILD_ID |
| 30 | +ARG BUILD_DATE |
| 31 | + |
| 32 | + |
| 33 | +ENV BUILDER=/usr/local/bin/fabric-chaincode-builder \ |
| 34 | + USER_UID=1001 \ |
| 35 | + USER_NAME=fabric-chaincode-builder \ |
| 36 | + CLIENT_TIMEOUT=5m \ |
| 37 | + FILE_SERVER_LISTEN_IP=0.0.0.0 \ |
| 38 | + FILE_SERVER_LISTEN_PORT=22222 \ |
| 39 | + SHARED_VOLUME_PATH=/data \ |
| 40 | + SIDECAR_LISTEN_ADDRESS=0.0.0.0:11111 |
| 41 | + |
| 42 | +RUN microdnf update -y |
| 43 | +RUN microdnf install -y shadow-utils iputils |
| 44 | +RUN groupadd -g 7051 ibp-user \ |
| 45 | + && useradd -u 7051 -g ibp-user -s /bin/bash ibp-user \ |
| 46 | + && microdnf remove -y shadow-utils \ |
| 47 | + && microdnf clean -y all; |
| 48 | + |
| 49 | +COPY --from=builder /go/src/github.ibm.com/ibp/chaincode-builder/build/fabric-chaincode-builder ${BUILDER} |
| 50 | +COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh |
| 51 | + |
| 52 | +USER ibp-user |
| 53 | + |
| 54 | +ENTRYPOINT ["docker-entrypoint.sh"] |
| 55 | +CMD [ "sh", "-c", "fabric-chaincode-builder --kubeconfig \"${KUBECONFIG}\" --kubeNamespace \"${KUBE_NAMESPACE}\" --clientTimeout \"${CLIENT_TIMEOUT}\" --peerID \"${PEER_ID}\" --sharedVolumePath \"${SHARED_VOLUME_PATH}\" --fileServerListenAddress \"${FILE_SERVER_LISTEN_IP}:${FILE_SERVER_LISTEN_PORT}\" --sidecarListenAddress \"${SIDECAR_LISTEN_ADDRESS}\" --fileServerBaseURL \"${FILE_SERVER_BASE_URL}\"" ] |
0 commit comments