forked from hyperledger/fabric-private-chaincode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.boilerplate-ecc
41 lines (31 loc) · 1.18 KB
/
Dockerfile.boilerplate-ecc
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
# Copyright IBM Corp. All Rights Reserved.
# Copyright 2020 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
# Description:
# Sets up the template of a docker environment to run FPC chaincode, just missing the chaincode's enclave.so*
#
# Configuration (build) parameters (for defaults, see below section with ARGs)
# - fpc image version: FPC_VERSION
# - sgxmode: SGX_MODE
# - Chaincode as a Server Port: CAAS_PORT
ARG FPC_VERSION=main
FROM hyperledger/fabric-private-chaincode-ccenv:${FPC_VERSION}
ARG SGX_MODE
ENV SGX_MODE=${SGX_MODE}
# Note: the library copied below is SGX_MODE dependent, so we
# define here a env which makes it easy recognizable which mode
# the container is. No default, though, as we do not control
# the build and rely on a proper value provided from outside.
ARG CAAS_PORT=9999
ARG CC_NAME="ecc"
ARG CC_PATH="/usr/local/bin"
ARG CC_LIB_PATH=${CC_PATH}"/enclave/lib"
RUN mkdir -p ${CC_LIB_PATH}
ENV SGX_SDK=/opt/intel/sgxsdk
ENV LD_LIBRARY_PATH=${SGX_SDK}/sdk_libs:${CC_LIB_PATH}
copy ecc/${CC_NAME} ${CC_PATH}/chaincode
copy ecc_enclave/_build/lib/libsgxcc.so ${CC_LIB_PATH}/
WORKDIR ${CC_PATH}
EXPOSE ${CAAS_PORT}
CMD ["chaincode"]