Wilson Wii
Wilson Wii

Reputation: 101

Socket on docker

I have written 3 pyhton script working on local and connected with socket.

I want to create docker containers for each script (one script = one container). But when I lauch the first one (just listenning on socket) i have this error :

JOB START
Traceback (most recent call last):
  File "/demo/classifier.py", line 35, in <module>
    socket.connect("tcp://%s:%s" % (config["SOCKET"]["Hostname"], config["SOCKET"]["PortDetection"]))
  File "/opt/conda/lib/python3.9/configparser.py", line 963, in __getitem__
    raise KeyError(key)
KeyError: 'SOCKET'

Upvotes: 1

Views: 117

Answers (1)

Wilson Wii
Wilson Wii

Reputation: 101

I haven't the right on the config file so I need to do chmod 777 on /config.ini

And now when I run my code, it find the config file with "Socket" in.

Upvotes: 1

Related Questions