[shim] Pass proxy variables to the container#3917
Merged
Merged
Conversation
Collaborator
Author
Test setupPrepare a VM with HTTP proxy:Install tinyproxysudo apt update
sudo apt install -y tinyproxy
sudo systemctl enable --now tinyproxyBlock egress except for tinyproxyPROXY_UID=$(id -u tinyproxy)
# let the tinyproxy process talk to the world
sudo iptables -A OUTPUT -m owner --uid-owner $PROXY_UID -j ACCEPT
# let anyone use loopback (so your app can reach the proxy on 127.0.0.1:8888)
sudo iptables -A OUTPUT -o lo -j ACCEPT
# keep already-open connections alive
sudo iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# reject everyone else's outbound HTTP/HTTPS
sudo iptables -A OUTPUT -p tcp -m multiport --dports 80,443 -j REJECTConfigure HTTP proxy for usersIt's required since Note, we use the lower case form – both Add these lines to Configure HTTP proxy for servicesAt least for Docker and Reload systemd and servicessudo systemctl daemon-reexec
sudo systemctl restart docker.serviceCheck the setup$ ssh debian@192.168.122.58 -i ~/.ssh/vm_debian$ curl https://api.github.com/zen
Avoid administrative distraction.
$ unset http_proxy https_proxy
$ curl https://api.github.com/zen
curl: (7) Failed to connect to api.github.com port 443 after 0 ms: Could not connect to serverDeploy an SSH fleettype: fleet
name: vm
ssh_config:
hosts:
- hostname: 192.168.122.58
user: debian
identity_file: ~/.ssh/vm_debianRun a jobtype: dev-environment
image: ubuntu # or alpine or fedora, all three package managers should workDisable env passing and check againRedeploy the fleet with additional type: fleet
...
env:
- DSTACK_DOCKER_PASS_ENV=Run the same run configuration |
jvstme
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #3906