-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running container (docker) image #1658
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I tried to run this via this example however the cluster DNS doesn't resolve:
|
Hi! This isn't supported at the moment as discussed in this issue. What you can do is run mirrord inside the container itself. |
Hi @aviramha , I am trying to implement step no. 1 as you have suggested and its little bit messy to implement. Can you suggest imporvements please?
|
Hi @uneet77 - why do you think you need step 2? This seems redundant |
I get it, step 2 is not needed. Thanks |
The k8s config might point to binaries (aws, az, gcloud) to get auth from, so those might be needed but need to see the kubeconfig info to understand better. In general mounting the kube config shuold be enough - you should get to a point where |
To extend this conversation, I've got mirrord working happily inside a docker container, but I'd like to expose the application that's tunnelled to the rest of the local network namespace. I appreciate this is probably not a considered usecase but thought I'd ask! Inspired by https://mirrord.dev/docs/using-mirrord/web-browsing/
version: '3.8'
services:
proxy:
build:
dockerfile_inline: |
FROM debian:12-slim
RUN <<EOF
apt-get -y update
apt-get install --no-install-recommends -y microsocks curl awscli ca-certificates lsof
rm -rf /var/lib/apt/lists/*
EOF
RUN curl -fsSL https://raw.githubusercontent.com/metalbear-co/mirrord/main/scripts/install.sh | bash
entrypoint: ["/usr/local/bin/mirrord"]
command:
- exec
- "--"
- microsocks
- -b
- "0.0.0.0"
healthcheck:
test: curl --fail --socks5 127.0.0.1:1080 http://checkip.amazonaws.com || exit 1
interval: 10s
timeout: 2s
retries: 3
start_period: 5s
ports:
- 1080:1080
restart: on-failure
volumes:
- $HOME/.kube/config:/root/.kube/config:ro
- $HOME/.aws/credentials:/root/.aws/credentials:ro
- $HOME/.aws/config:/root/.aws/config:ro
test:
image: quay.io/curl/curl:latest
depends_on:
- proxy
command:
- --progress-bar
- --retry-connrefused
- --retry
- "1000"
- --retry-delay
- "10"
- --retry-max-time
- "40"
- --socks5-hostname
- "proxy:1080"
- http://checkip.amazonaws.com
restart: "no" Result:
My assumption is that the bind address being set on microsocks isn't being matched by mirrord wrapping it.
With mirrord running and wrapping microsocks:
Without (microsocks as the entrypoint instead of mirrord):
So my question - can you configure mirrord to expose the process on 0.0.0.0 so I can just wrap a socks5 proxy using mirrord in docker for easier use in our local docker-compose stacks? Would be useful for both proxying the host browser via the exposed 1080 port, and access from other containers in the compose network stack. Edit: A further extended example if you wanted http as well as socks5 proxies: version: '3.8'
services:
socks5-proxy:
build:
dockerfile_inline: |
FROM debian:12-slim
RUN <<EOF
apt-get -y update
apt-get install --no-install-recommends -y microsocks curl awscli ca-certificates lsof
rm -rf /var/lib/apt/lists/*
EOF
RUN curl -fsSL https://raw.githubusercontent.com/metalbear-co/mirrord/main/scripts/install.sh | bash
entrypoint: ["/usr/local/bin/mirrord"]
command:
- exec
- "--"
- microsocks
- -b
- "0.0.0.0"
healthcheck:
test: curl --fail --socks5 127.0.0.1:1080 http://checkip.amazonaws.com || exit 1
interval: 10s
timeout: 2s
retries: 3
start_period: 5s
ports:
- 1080:1080
restart: on-failure
volumes:
- $HOME/.kube/config:/root/.kube/config:ro
- $HOME/.aws/credentials:/root/.aws/credentials:ro
- $HOME/.aws/config:/root/.aws/config:ro
http-proxy:
build:
dockerfile_inline: |
FROM debian:12-slim
RUN <<EOF
apt-get -y update
apt-get install --no-install-recommends -y tinyproxy curl awscli ca-certificates lsof
rm -rf /var/lib/apt/lists/*
EOF
RUN curl -fsSL https://raw.githubusercontent.com/metalbear-co/mirrord/main/scripts/install.sh | bash
COPY <<EOF /etc/tinyproxy/tinyproxy.conf
Port 8888
Listen 0.0.0.0
Timeout 600
Allow 127.0.0.1
Allow 0.0.0.0
EOF
entrypoint: ["/usr/local/bin/mirrord"]
command:
- exec
- "--"
- tinyproxy
- -d
healthcheck:
test: curl --fail --proxy http://127.0.0.1:8888 http://checkip.amazonaws.com || exit 1
interval: 10s
timeout: 2s
retries: 3
start_period: 5s
ports:
- 8888:8888
restart: on-failure
volumes:
- $HOME/.kube/config:/root/.kube/config:ro
- $HOME/.aws/credentials:/root/.aws/credentials:ro
- $HOME/.aws/config:/root/.aws/config:ro
test-socks5-proxy:
image: quay.io/curl/curl:latest
depends_on:
- socks5-proxy
command:
- --progress-bar
- --retry-connrefused
- --retry
- "10"
- --retry-delay
- "10"
- --retry-max-time
- "40"
- --socks5-hostname
- "socks5-proxy:1080"
- http://checkip.amazonaws.com
restart: "no"
test-http-proxy:
image: quay.io/curl/curl:latest
depends_on:
- http-proxy
environment:
- http_proxy=http://http-proxy:8888
- https_proxy=http://http-proxy:8888
command:
- --progress-bar
- --retry-connrefused
- --retry
- "10"
- --retry-delay
- "10"
- --retry-max-time
- "40"
- http://checkip.amazonaws.com
restart: "no"
|
hi @danielloader , appreciate the elaborate explanation. |
Currently, users can use Docker + mirrord by either ways:
It might make sense to add a more sugary way of doing it - for example
mirrord runc <image_name>
. This would actually run the container image using Docker or any Docker compatible API while doing all the necessary work to make it work out of the box.The text was updated successfully, but these errors were encountered: