docker run コマンドの link オプションで受け取った環境変数を bash スクリプト内で解析する。
# !/bin/bash
URL=tcp://127.0.0.1:80
IPPORT=${URL#*//}
# IP
echo ${IPPORT%:*}
# Port
echo ${IPPORT#*:}
参考
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
docker run コマンドの link オプションで受け取った環境変数を bash スクリプト内で解析する。
# !/bin/bash
URL=tcp://127.0.0.1:80
IPPORT=${URL#*//}
# IP
echo ${IPPORT%:*}
# Port
echo ${IPPORT#*:}
参考
Register as a new user and use Qiita more conveniently
Go to list of users who liked