docs(examples): supply-chain-app to copy env into child containers
See original GitHub issueDescribe the bug
Depends on #1580
Right now if you are in a corporate firewall/proxy setup that’s locked down tight enough, then the supply chain app example won’t work because your proxy settings are not getting transferred onto the child containers that the example app launches. This leads to network related issues where for example docker containers for fabric peers in the Fabric AIO test ledger cannot be pulled.
To Reproduce
Try to launch this from behind a corporate proxy and watch it fail:
docker run \
--rm \
--privileged \
-p 3000:3000 \
-p 3100:3100 \
-p 3200:3200 \
-p 4000:4000 \
-p 4100:4100 \
-p 4200:4200 \
ghcr.io/hyperledger/cactus-example-supply-chain-app:2021-09-08--docs-1312
Expected behavior
The example works the same way.
Logs/Stack traces
N/A
Screenshots
N/A
Cloud provider or hardware configuration:
Dev machine
Operating system name, version, build:
N/A (should be OS independent)
Hyperledger Cactus release version or commit (git rev-parse --short HEAD):
Either a semantic version of the release you are using such as 1.0.0
or a git
commit hash if you are directly working with code from the git repository.
Hyperledger Cactus Plugins/Connectors Used
Fabric, Quorum, Besu
Additional context
Not yet a 100% sure if this will solve it, but it’s the most sensible first step to take IMO: Copy the environment variables of the host process to the child containers.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
@jagpreetsinghsasan You could just write the code “flying blind” and then ask @izuru0 to verify it on their corporate network. More context to explain the above: This issue was borne out of the need for Izuru to be able to run examples on their corporate network that has heavily restricting proxies configured. So if you cannot reproduce that environment, that’s fine because we have someone who can that you can work with. If you need tips on how to do the implementation I can give more specific guidance as well. I’d start by looking at the code changes made by the PR that I resolved the related #1580 issue with (which was a prerequisite to this one)
Hi @izuru0 I have added the possible solution to run supplychain app for proxied environments. Can you test that on your system (as I dont have the proxy environment)? For that to work, all you need to do is to run supplychain app from my cloned branch.
The branch having the working code is: https://github.com/jagpreetsinghsasan/cactus/tree/feature-1468 Once you have this branch code, run the following commands from root cactus folder
npm run install-yarn
yarn configure
yarn build:dev
cd ./examples/supply-chain-app
yarn --no-lockfile
cd ../..
After this, you need to add the following (one or more of these, depending upon your proxy settings) to the vscode launch.json file under the “Example: Supply Chain App” configuration, under “env” section “env”: { “TS_NODE_PROJECT”: “${workspaceFolder}/tsconfig.json”, “HTTP_PROXY”: " ", “HTTPS_PROXY”: " ", “FTP_PROXY”: " ", “NO_PROXY”: " ", }, (Only mention the fields required, if lets say FTP_PROXY isn’t required, removed the line “FTP_PROXY”: " ")
And then you can run supplychain app from vscode “Run and Debug” option and see if that solves your problem.
If this works, we can then test out the supplychain docker image as well. (code is already in place, just need to test this once before moving to the next step).