Docker Community Forums

Share and learn in the Docker community.

Error while executing a python zipped module from container. Runs fine outside of container

docker

(Pulkitagarwal04) #1

I have a Docker built FROM python:3 image.
I can execute a python script from that Dockerfile using

ENTRYPOINT [ “python3”, “./trigger_script.py” ]

In the trigger_script I try to download a zip and run it using subprocess
check_call(“python3”, zip_sample.zip)

I get error while running the code in docker saying it cannot find main.py while it is there and I can execute the ZIP locally just fine.

I suspect this is because of some library that I need to install. Any suggestions?


(Martin Terp) #2

Hi :slight_smile:

Can you provide your Dockerfile?


(Pulkitagarwal04) #3

Thanks for replying so quick.
Yesterday I figured out the root cause - My directory where I was downloading the zip was not created correctly and the error message was not helpful.
Once I corrected that through “RUN mkdir -p /directory/to/download” things worked!