Hey,

what you need is the ip address associated with the network interface. This
is how you are able to get it inside of a container:

ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1

If you used this inside of a script assign it to a variable:

IP="$(ifconfig eth0 | grep "inet addr:" | cut -d : -f 2 | cut -d " " -f 1)"

You might have to escape " depending on your shell

IP="$(ifconfig eth0 | grep \"inet addr:\" | cut -d : -f 2 | cut -d \" \" -f
1)"

You might also have to install net-tools for Debian based images.


Just pass it like this -ip $IP


If you use an Orchestrator like Cattle with Rancher, there might be
different ways:

IP="$(curl 'http://rancher-metadata/2015-12-19/self/container/primary_ip')"

works in Rancher

2017-05-30 22:50 GMT+02:00 Geo B. <bachel...@gmail.com>:

> I am currently looking to migrate all my public servers to docker but
> there are still some issues:
>
> 1- As docker doesn't know it's own external ip, we have to bind srcds to
> 0.0.0.0 or the container crash. This also lead to another issue, if you try
> to assign another IP address than the default gateway of your box, it will
> result in a crash.
>
> 2- also related to bind issue, nobody can join someone playing on a docker
> server because the broadcasted ip is 0.0.0.0
>
> And there are more issues related to it.
>
> The actual workaround is to share the host network with the container
> using net: host but this is a REAL security breach.
>
> I know that Vitaliy already added a car to broadcast sourcetv ip using
> docker (kind of NAT), maybe instead of reworking srcds it could be possible
> to add 1 car ( why not using +net_public_address ? ) to force broadcast the
> right IP ?
> This would not fix all issues as this is a workaround, maybe a real rework
> of srcds is needed but containers is the future of hosting and as Valve is
> pushing some update (http logs) maybe it could be interesting to go in this
> way.
>
> _______________________________________________
> Csgo_servers mailing list
> Csgo_servers@list.valvesoftware.com
> https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers
>
_______________________________________________
Csgo_servers mailing list
Csgo_servers@list.valvesoftware.com
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/csgo_servers

Reply via email to