Transparent-proxy any applications in the host network.
310
A simple container designed to transparent-proxy other containers in host network.
It's useful if you want to:
http_proxyOne of the use cases is to proxy the home-assistant container, so that the HACS plugin can use proxy while keeping the benefit of using the host network in Home Assistant.
Run your existing service with a specific user (-u <name|uid>[:<group|gid>]).
docker run --rm -d -u 1099 --network=host <your-service>
Run docker-host-proxy with your proxy settings.
docker run --rm -d --network=host \
--cap-add NET_ADMIN \
--cap-add NET_RAW \
-e PROXIED_UID=1099 \
-e PROXY_SERVER=127.0.0.1 \
-e PROXY_PORT=7897 \
homanw104/docker-host-proxy:latest
Alternatively, you can simply add the proxy service to your docker compose file.
services:
your-service:
image: <your-service>
network_mode: host
# Designate a user for your existing services that you want to proxy.
# It must be the same as the PROXIED_UID set in the proxy container
# and it will be used to add specific iptables rules.
user: "1099"
docker-host-proxy:
image: homanw104/docker-host-proxy:latest
network_mode: host
environment:
- PROXIED_UID=1099
- PROXY_SERVER=127.0.0.1
- PROXY_PORT=7897
# Other optional variables available
# - LOG_DEBUG=off
# - LOG_INFO=on
# - LOCAL_IP=127.0.0.1
# - LOCAL_PORT=17777
# - PROXY_TYPE=socks5
cap_add:
- NET_ADMIN
- NET_RAW
Content type
Image
Digest
sha256:61fa37add…
Size
4.8 MB
Last updated
over 1 year ago
docker pull homanw104/docker-host-proxy