SHARE
TWEET

Restore dockerfile script




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"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.