Friday, 4 October 2019

Docker Debug

When trying to start a new docker container I was getting an error from python about a missing module:

pi@raspberrypi:~/ServerSSL $ python RestServerSSL.py
Traceback (most recent call last):
  File "RestServerSSL.py", line 9, in <module>
    from web.wsgiserver import CherryPyWSGIServer
ImportError: No module named wsgiserver 

I had updated the python code to incorporate SSL and suspected I had a different version of web.py on the image to that I was using locally.

I therefore wanted to understand what exactly was installed on the image.

The command below allowed me to startup a container with an interactive bash shell:

docker run -it --entrypoint /bin/bash <ImageName> -s

Then I could run:

pip list 

to list out all the versions of python packages.

It turned out that web.py was at version 0.40 on the image, and 0.38 on my laptop. I upgraded the version on the laptop with:

pip install --upgrade web.py

Then I made the necessary changes (see here for more) and rebuilt the image.
 




No comments:

Post a Comment