5

Is there any why to browse a docker image using ssh or equivalent? My motivation is to compare two docker images using beyond compare

edit: i am not interested in just listing file names, I need the content and I would like to be able compare two images, including content of the files.

yigal
  • 3,923
  • 8
  • 37
  • 59
  • 5
    I don't think this is a duplicate, since this question specifically asks how to view image content "without running it". The linked question has answers that touch on that, but it is not the main discussion. – Culme Nov 26 '20 at 10:51
  • 2
    this is not duplicate. looks like who ever marked duplicate did not pay attention on "without running" part. – Mahes Feb 10 '21 at 17:01
  • One solution: https://stackoverflow.com/questions/66141391/how-to-view-files-inside-docker-image-without-running-it – Mahes Feb 10 '21 at 17:02

2 Answers2

12

If what you want is exploring a docker image then you can use a tool named dive.

You cannot directly compare files content but at least you can browse layer contents and see which files have been added/removed/modified/unmodified.

To analyze a Docker image simply run:

dive <your_image>

enter image description here

Simon C
  • 316
  • 2
  • 5
2

You might do something like docker image history <your image name here> This will give you the history of how the image is build and you could compare it to another image...

or docker inspect <your image name here>

Ivonet
  • 2,492
  • 2
  • 15
  • 28
  • Not what I expected to find, but `docker inspect ` actually was useful to debug entrypoint. Thanks! – Lukenzo Feb 18 '22 at 12:38