-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (57 loc) · 2.85 KB
/
Copy pathDockerfile
File metadata and controls
67 lines (57 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Copyright contributors to the Hyperledger Fabric Operator project
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ARG ARCH
ARG REGISTRY
ARG GO_VER
FROM ${REGISTRY}/ibp-golang.${ARCH}:${GO_VER}-ubi9 as builder
COPY . /go/src/github.ibm.com/ibp/chaincode-builder
WORKDIR /go/src/github.ibm.com/ibp/chaincode-builder
RUN GOOS=linux GOARCH=$(go env GOARCH) go build -o build/chaincode-builder ./cmd/ibp-builder
FROM registry.access.redhat.com/ubi9/ubi-minimal
ARG IBP_VER
ARG BUILD_ID
ARG BUILD_DATE
LABEL name="IBM Blockchain Platform External Chaincode Builder and Launcher" \
io.k8s.display-name="IBM Blockchain Platform Chaincode Builder and Launcher" \
summary="The chaincode builder and launcher image for IBM Blockchain Platform." \
description="This image contains the chaincode builder and launcher for the IBM Blockchain Platform and Red Hat UBI 8 as the base OS." \
io.k8s.description="This image contains the chaincode build and launcher for the IBM Blockchain Platform and Red Hat UBI 8 as the base OS." \
vendor="IBM" \
maintainer="IBM" \
version=$IBP_VER \
release=$BUILD_ID \
ibp.build-date=$BUILD_DATE \
io.openshift.tags="blockchain"
ENV BUILDER=/usr/local/bin/chaincode-builder \
USER_UID=1001 \
USER_NAME=chaincode-builder \
CLIENT_TIMEOUT=5m \
FILE_SERVER_LISTEN_IP=0.0.0.0 \
FILE_SERVER_LISTEN_PORT=22222 \
SHARED_VOLUME_PATH=/data \
SIDECAR_LISTEN_ADDRESS=0.0.0.0:11111
RUN microdnf update -y
RUN microdnf install -y shadow-utils iputils
RUN groupadd -g 7051 ibp-user \
&& useradd -u 7051 -g ibp-user -s /bin/bash ibp-user \
&& microdnf remove -y shadow-utils \
&& microdnf clean -y all;
COPY --from=builder /go/src/github.ibm.com/ibp/chaincode-builder/build/chaincode-builder ${BUILDER}
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
USER ibp-user
ENTRYPOINT ["docker-entrypoint.sh"]
CMD [ "sh", "-c", "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}\"" ]