Giter Club home page Giter Club logo

Comments (4)

sirupsen avatar sirupsen commented on July 17, 2024

We just --net=host I believe. It sounds useful to forward by default though.

from toxiproxy.

xthexder avatar xthexder commented on July 17, 2024

The current Dockerfile already has the port defined: https://github.com/Shopify/toxiproxy/blob/master/Dockerfile#L8
There's no way to actually make it forward with default arguments though.
What you want is the -P argument, which will forward all the ports defined in the Dockerfile.

from toxiproxy.

jacobbednarz avatar jacobbednarz commented on July 17, 2024

We just --net=host I believe.

This doesn't seem to forward any ports for me but I could be very well missing something here.

$ docker run -it -d --net=host shopify/toxiproxy
660a2f7b01d63b3f915fbed12e27d20c623e4d9f219ee411ee27f9d3b8994f0d

$ docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                  NAMES
660a2f7b01d6        shopify/toxiproxy                "/app/toxiproxy -host"   2 seconds ago       Up 1 seconds                               adoring_ramanujan

What you want is the -P argument, which will forward all the ports defined in the Dockerfile.

The problem with using this is that it ends up giving a random port which might a PITA to manage in your tests if you need to reference it.

$ docker run -it -d -P shopify/toxiproxy
fbe6cad094cc5672f7d4d75561dea6317b303073bc4d3466861d3936bdfb3205

$ docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                     NAMES
fbe6cad094cc        shopify/toxiproxy                "/app/toxiproxy -host"   3 seconds ago       Up 1 seconds        0.0.0.0:32768->8474/tcp   sick_fermi

I think to make this slightly easier for out of the box usage, we could update the documentation to include -p 8474:8474 (which I feel would solve my concerns from above).

from toxiproxy.

sirupsen avatar sirupsen commented on July 17, 2024

--net=host assumes that all other containers are in the same networking namespace (i.e. they're run with --net=host) or that you don't run other tests in a networking namespace (e.g. not in a container).

from toxiproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.