Last active
September 26, 2019 05:54
-
-
Save uzl/52bf0bf510ff7256a166ffb6ec30dc16 to your computer and use it in GitHub Desktop.
To generate the docker file, docker history can be used.
This file contains 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
docker history --no-trunc c3555fec4fe6 $argv | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && ,\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*[kMG]*B\s*$,,g' | head -n -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sourece: https://stackoverflow.com/questions/19104847/how-to-generate-a-dockerfile-from-an-image