Skip to content

Instantly share code, notes, and snippets.

@marmotte
Created June 13, 2014 17:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marmotte/e6db46963a14c1e4be10 to your computer and use it in GitHub Desktop.
Save marmotte/e6db46963a14c1e4be10 to your computer and use it in GitHub Desktop.
dockerコンテナ起動時にコンテナに振り当てられたIPを取得する docker runのラッパー
#/bin/bash
echo $@
CONTAINER_ID=$(docker run $@)
docker inspect --format='{{.NetworkSettings.IPAddress}}' $CONTAINER_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment