Created
April 24, 2019 11:48
-
-
Save thbkrkr/c5cdf18160176c708f0ecab6403d386f to your computer and use it in GitHub Desktop.
Reverse Docker image
This file contains hidden or 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
| #!/bin/sh | |
| docker history --no-trunc "$1" \ | |
| | 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