Proxy Setting on docker

Hi Team,

I’m setting up a K6 project and we are running locally by the below command.

$env:HTTPS_PROXY=“http://localhost:4128”; k6 run --out=influxdb=http://localhost:8086/myk6instance .\testRunner.js

But now I’m looking for dockerize solution, for that I able to define the influxdb out on the environment section of the docker compose like below. Is there is way to set the proxy also configure like that.

environment:
** - K6_OUT=influxdb=http://influxdb:8086/k6**

Hi Gerard,

Is there is way to set the proxy also configure like that.

Yes, that should work. Have you tried it?

Do keep in mind that localhost within the container doesn’t refer to the host machine, but to the container itself. So you’ll need to make your proxy accessible from inside the container for this to work, or start it within the same container or network as k6. This is out of scope for the k6 forum, so I suggest you reach out to someone familiar with Docker and your setup, or just do some searching online. E.g. this Stack Overflow thread might be helpful. Good luck!

1 Like