SHARE
TWEET

Restore dockerfile script

a guest Aug 19th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. docker history --no-trunc "$1" | \
  3. sed -n -e 's,.*/bin/sh -c #(nop) \(MAINTAINER .*[^ ]\) *0 B,\1,p' | \
  4. head -1
  5. docker inspect --format='{{range $e := .Config.Env}}
  6. ENV {{$e}}
  7. {{end}}{{range $e,$v := .Config.ExposedPorts}}
  8. EXPOSE {{$e}}
  9. {{end}}{{range $e,$v := .Config.Volumes}}
  10. VOLUME {{$e}}
  11. {{end}}{{with .Config.User}}USER {{.}}{{end}}
  12. {{with .Config.WorkingDir}}WORKDIR {{.}}{{end}}
  13. {{with .Config.Entrypoint}}ENTRYPOINT {{json .}}{{end}}
  14. {{with .Config.Cmd}}CMD {{json .}}{{end}}
  15. {{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. OK, I Understand
 
Top