question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docs(examples): supply-chain-app to copy env into child containers

See original GitHub issue

Describe 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.

cc: @takeutak @hartm @izuru0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
petermetzcommented, Oct 12, 2022

@petermetz In my case, when I am trying to run the above supplychain docker image in a corporate network, I am not even able to pull the image disappointed image

@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)

0reactions
jagpreetsinghsasancommented, Oct 20, 2022

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).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dockerfile reference - Docker Documentation
A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image....
Read more >
Best practices for building containers | Cloud Architecture Center
This article describes a set of best practices for building containers. These practices cover a wide range of goals, from shortening the ...
Read more >
Passing environment variables to a container
You can pass environment variables to your containers in the following ways: ... the first value of the variable is used and subsequent...
Read more >
Cloud Foundry Environment Variables
The following example demonstrates the environment variables cf env displays: $ cf env my-app Getting env variables for app my-app in org ...
Read more >
Downstream pipelines - GitLab Docs
parent_pipeline for parent-child pipelines. For example, to control jobs in multi-project pipelines in a project that also runs merge request pipelines: job1 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found