Skip to content

Instantly share code, notes, and snippets.

@WisdomWolf
Forked from lalyos/generate-compose.sh
Created May 11, 2017 20:57
Show Gist options
  • Save WisdomWolf/81780efc97850b3b7ec84619a854cd79 to your computer and use it in GitHub Desktop.
Save WisdomWolf/81780efc97850b3b7ec84619a854cd79 to your computer and use it in GitHub Desktop.
generate docker-compose.yml by inspecting a running container
docker-yml() {
docker inspect -f $'
{{.Name}}
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
environment: {{range .Config.Env}}
- {{.}}{{end}}
' $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment