Last active
November 8, 2019 01:11
-
-
Save andrewodri/82f4942f5f50743028c96343f1aecbc6 to your computer and use it in GitHub Desktop.
Generate host file compatible syntax from Docker Network
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
docker network inspect $(docker network ls --format '{{ .ID }}') --format '{{ if (index .Labels "media.promoto.host") }}{{ range (split (index .Labels "media.promoto.host") ",") }}{{ printf "%s %s\n" (index $.IPAM.Config 0).Gateway . }}{{ end }}{{ end }}' | sed '/^$/d' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment