The following is how you can sort of reverse engineer a docker image to get the Dockerfile using docker history
. You can use a sophisticated tool like dive
but that has its own problem.
Lets assume you have an image nvcr.io/nvidia/pytorch:23.10-py3
Run the following command to create a semi correct Dockerfile : docker history --no-trunc nvcr.io/nvidia/pytorch:23.10-py3 --format '{{ .CreatedBy }}' | tail -r > Dockerfile
The dockerfile:
/bin/sh -c #(nop) ARG RELEASE
/bin/sh -c #(nop) ARG LAUNCHPAD_BUILD_ARCH