Skip to content

Instantly share code, notes, and snippets.

@andyshinn
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save andyshinn/b1465075fb4f22c0c7ca to your computer and use it in GitHub Desktop.

Select an option

Save andyshinn/b1465075fb4f22c0c7ca to your computer and use it in GitHub Desktop.

port variable not available for next command?

$ /bin/sh -c "port=$(docker inspect -f '{{range $i, $e := .HostConfig.PortBindings }}{{$p := index $e 0}}{{$p.HostPort}}{{end}}' firehose-01); echo Port: $port"
Port:

docker inspect is returning correct port

$ /bin/sh -c "echo Port: $(docker inspect -f '{{range $i, $e := .HostConfig.PortBindings }}{{$p := index $e 0}}{{$p.HostPort}}{{end}}' firehose-01)"
Port: 49153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment