I’m have Dockerfile that run redis on one image, and python code on other on
For now I’m working on windows 10
I’m trying to connect USB port that connect to local comp to my python app on docker through pySerial
That’s my docker file
FROM python:2.7
WORKDIR /app
COPY . /app
RUN pip install -r requirements.txt
CMD [“python”, “main_2.py”]
and the error that I get when I tries to run main_2.py on docker
is that:
Traceback (most recent call last):
File “main_2.py”, line 1, in
from rfbridge import RFBridge
File “/app/rfbridge.py”, line 9, in
ser = serial.Serial(COM,115200)
File “/usr/local/lib/python2.7/site-packages/serial/serialutil.py”, line 240, in init
self.open()
File “/usr/local/lib/python2.7/site-packages/serial/serialposix.py”, line 268, in open
raise SerialException(msg.errno, “could not open port {}: {}”.format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: ‘/dev/ttyUSB0’
I’ll be very great full for your help