Pages

Sunday, July 27, 2014

Automatically tunnel all ports of running docker instances in boot2docker

$ docker ps -q | xargs -n 1 docker inspect | jq '.[0].NetworkSettings.Ports +{} | map(select(. != null)[0].HostPort) | map("-L \(.):localhost:\(.)") ' | sed -n 's/.*"\(.*\)".*/\1/p' |xargs boot2docker ssh -N

It requires https://jqplay.org/, that comes with brew: brew install jq




commandlinefu.com


by David Winterbottom (codeinthehole.com)






from All commands http://ift.tt/1teJmga

No comments:

Post a Comment