Pull dockerfile without pulling entire image

So i am trying to get the default environment variables. volumes and exposed ports. the way i am doing this is pulling the entire image and then inspecting it and parsing the json.

Is there a way to get the dockerfile without downloading 800 MB images?
Appreciate any input as downloading every image is not really feasable for my intent.