Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- docker history --no-trunc "$1" | \
- sed -n -e 's,.*/bin/sh -c #(nop) \(MAINTAINER .*[^ ]\) *0 B,\1,p' | \
- head -1
- docker inspect --format='{{range $e := .Config.Env}}
- ENV {{$e}}
- {{end}}{{range $e,$v := .Config.ExposedPorts}}
- EXPOSE {{$e}}
- {{end}}{{range $e,$v := .Config.Volumes}}
- VOLUME {{$e}}
- {{end}}{{with .Config.User}}USER {{.}}{{end}}
- {{with .Config.WorkingDir}}WORKDIR {{.}}{{end}}
- {{with .Config.Entrypoint}}ENTRYPOINT {{json .}}{{end}}
- {{with .Config.Cmd}}CMD {{json .}}{{end}}
- {{with .Config.OnBuild}}ONBUILD {{json .}}{{end}}' "$1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement