I made a python code that connects with a SFTP server and reads data. The python script worked well when I ran it on my machine.
For deployment purpose I needed a docker image. So I made one.
However when I run the docker container I get the following Error:
Dockerfile code:
FROM python:3
ADD sftp.py /
ADD config.properties /
RUN pip install pandas pysftp requests configparser
CMD ["python","./sftp.py"]
Python code for connecting to sftp:
cnopts = pysftp.CnOpts(knownhosts=None)
cnopts.hostkeys = None
with pysftp.Connection(host=hostname,username=username,password=password,cnopts=cnopts) as sftp:
sftp.chdir("Optimove_Output")
I am unable to figure out why it is not working within a docker container. As this code works when run without a container.