Outputs the equivalent argv of what you would get with a docker run
command.
This considers the given image's CMD
, ENTRYPOINT
, and docker run
's --entrypoint
flag.
$ run hello-world@sha256:96ebeec770e1af26469c98913277e1c3b40933202ca398cefc16177c3f26cc75
["cmd","/C","type C:\\hello.txt"]
$ run --entrypoint /crane hello-world@sha256:96ebeec770e1af26469c98913277e1c3b40933202ca398cefc16177c3f26cc75
["/crane"]
$ run hello-world@sha256:96ebeec770e1af26469c98913277e1c3b40933202ca398cefc16177c3f26cc75 crane
["crane"]
$ run gcr.io/go-containerregistry/crane version
["/ko-app/crane","version"]
$ run --entrypoint '["crane", "ls"]' gcr.io/go-containerregistry/crane ubuntu
["crane","ls","ubuntu"]
Very cool! I think I'll use your tool next time I demo (with attribution, of course)!
If anyone's interested in a bit of explanation around
CMD
andENTRYPOINT
and using them together, this section in a little guide I wrote up for a Docker presentation might help: https://dockerbyexample.dev/basics/time/