Assume that you have a Topmost Fabric-CA (TCA) server which is set up and running. Now coming on to your question, we can say that you are set to enable an Intermediate Fabric-CA (ICA) server which is attached to the assumed RCA server.
I tried the following line of commands and it worked. You should try the same as well.
version: '2'
networks: fabric-ca:
services:
interca:
container_name: interca
image: hyperledger/fabric-ca
command: /bin/bash -c '/scripts/start-intermediate-ca.sh 2>&1 | tee /data/logs/ica.log'
environment:
- FABRIC_CA_SERVER_HOME=/etc/hyperledger/fabric-ca
- FABRIC_CA_SERVER_CA_NAME=interca
- FABRIC_CA_SERVER_INTERMEDIATE_TLS_CERTFILES=/data/tca-ca-cert.pem
- FABRIC_CA_SERVER_CSR_HOSTS=interca
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_DEBUG=true
- BOOTSTRAP_USER_PASS=interca-admin:interca-adminpw
- PARENT_URL=https://tca-admin:tca-adminpw@tca:7054
- TARGET_CHAINFILE=/data/interca-ca-chain.pem
volumes:
- ./data:/data
- ./scripts:/scripts
- ./data/fabric_ca_test/interca:/etc/hyperledger/fabric-ca
networks:
- fabric-ca
ports:
- 10.10.10.101:7055:7054
You should also note that we have been using script start-intermediate-ca.sh
#!/bin/bash
#
set -e
# Initialize intermediate CA (interca)
fabric-ca-server init -b $BOOTSTRAP_USER_PASS -u $PARENT_URL
# Copy interca certificate chain to a data directory that can be used by others
cp $FABRIC_CA_SERVER_HOME/ca-chain.pem $TARGET_CHAINFILE
# Now start the interca
fabric-ca-server start --config $FABRIC_CA_SERVER_HOME/fabric-ca-server-config.yaml