在boot2docker中自动隧道运行docker实例的所有端口

它需要https://jqplay.org/,这是brew自带的:brew install jq
.

0

linux命令: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 -N ssh boot2docker |xargs 's/.*"\(.*\)".*/\1/p' -n sed | ' \(.):localhost:\(.)") map("-L | null)[0].HostPort) != map(select(. | +{} '.[0].NetworkSettings.Ports jq | inspect docker 1 -n xargs | -q ps docker 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 -Nrootopen.com
linux命令: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 -N ssh boot2docker |xargs 's/.*"\(.*\)".*/\1/p' -n sed | ' \(.):localhost:\(.)") map("-L | null)[0].HostPort) != map(select(. | +{} '.[0].NetworkSettings.Ports jq | inspect docker 1 -n xargs | -q ps docker 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 -Nrootopen.com
agnc 2018-03-08 23:47:48
输出

评论

相关推荐
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

热门文章