HTTP GET not working from docker container

Dear all,

I am developing a container image that runs correctly on my dev-container within Visual Studio Code but fails when I run the image outside that dev-container.

The instruction is very simple:

HTTP.get(“http://169.254.170.2/v3/task”), this runs correctly on my dev-container.

The same instruction, however, does not run outside my dev-container, either in CMD or in another docker container. I believe it runs on dev-container because of something specified on docker-compose.yaml

Can you please provide support?

What is “outside that dev-container”? Are you running some kind of “Docker in Docker” in the dev container?

Also what is HTTP.get()? How do you actually run it? Please, show your Dockerfile and compose file or at least parts that are not secret.