LanikSJ/dfimage

๐Ÿ› [BUG] - TypeError: 'NoneType' object is not subscriptable

mikecurrancs opened this issue ยท 2 comments

Description

When executing the following command against any image I have

docker run -v /var/run/docker.sock:/var/run/docker.sock laniksj/dfimage:latest

I get an error instead of the Dockerfile output

Docker Config

1. Open Docker Desktop
2. Docker Desktop > About

Docker Desktop Version = 
4.4.2 (73305)

Reproduction steps

1. Execute docker run -v /var/run/docker.sock:/var/run/docker.sock laniksj/dfimage:latest container:test
2. Expect to see the resulting Dockerfile output
3. Instead get an error for entrypoint.py 
Downloaded newer image for laniksj/dfimage:latest
Traceback (most recent call last):
  File "/app/entrypoint.py", line 126, in <module>
    __main__ = MainObj()
               ^^^^^^^^^
  File "/app/entrypoint.py", line 23, in __init__
    self._get_layers_with_images()
  File "/app/entrypoint.py", line 69, in _get_layers_with_images
    self.layers_with_images[last_layer_id] = i["RepoTags"][0]
                                             ~~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

OS

Mac

Doesn't look like your container exists based on that output or in this case the tag may not exist.

Thanks for the response, this appears to be an issue with how it interacts with docker on Mac Sonoma 14.2

Image discovery never happens.

Works fine on my Ubuntu nuk server