FROM pypi/dnslib
ADD dns.py /
CMD [“python”, “dns.py”]
After building the image and trying to run it, my application throws an error that there is no dnslib module.
I don’t see the image trying to install/build the pypi/dnslib.
Without my CMD , the first thing I see is it collecting/installing dnslib via pip. I drop into shell, I am able to start my application.
I wasn’t able to post my full comment as it was detecting links in the post…
When I remove the line CMD [“python”, “dns.py”] and build the docker image, then run it,the output from docker shows it is collecting and installing pip.
I have tried using an entrypoint to run my application however have the same issue.
This is the dockerfile for pypi/dnslib
FROM python
CMD [ “pip”, “install”, “dnslib==0.9.6” ]
If u are in charge of the source image, then you might change the cmd to a run and have it do the install at build time instead of run time.
Then others can extend the base easily
If u are not in charge, then you will have to discover and include the base image cmd with yours, of course executing theirs before yours