Condition

Host could not visit Intenet directly, need to set up proxy to connect Internet. Under this situation, the docker containers could not visit Internet directly either.

Solution

Option 1

Change the route table, transfer all request to host (this was succeed, but I could not recall the details, need verified later)

Option 2

In docker instance, using below command to change the network:

1
2
3
export http_proxy=
export https_proxy=
export no_proxy=

In addition, if you meet DNS problem, manually update /etc/resolv.conf could work for one time (invalid after reboot or reconnect, for persist this conf please google).

You could also add above configuration in docker-compose.yml if you are running instance by this file.

1
2
3
4
5
6
7
8
9
10
11
12
13
version: '3'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
environment:
FLASK_ENV: development]
http_proxy: xxxx # update here
redis:
image: "redis:alpine"

DNS error, could not resolve xxx….

If the DNS you are setting is a domain name, try to use IP address directly.

Ref: cheatsheet of running hyperledger/comoiser

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
1.
composer archive create -t dir -n .

2.
composer network install --card [email protected] --archiveFile [email protected] -o npmrcFile=/Users/bangqchi/Programming/cnpm/.cnpmrc

composer network upgrade --card [email protected] --networkName tutorial-network --networkVersion 0.0.7 -O npmrcFile=/Users/bangqchi/Programming/cnpm/.cnpmrc


3.
composer network start --networkName tutorial-network --networkVersion 0.0.7 --networkAdmin admin --networkAdminEnrollSecret adminpw --card [email protected] --file networkadmin.card

composer card import --file networkadmin.card

4.
composer network ping --card [email protected]

5.
composer-rest-server

# To restart the REST server using the same options, issue the following command:

composer-rest-server -c [email protected] -n never -u true -d tutorial-network -w true