I’m trying to create my Python Docker image. I need to install pyserial via pip. The problem is that one of the .py files inside the pyserial package is outdated so I need to change it with mine which is an updated version.
My Docker file first install pyserial package via pip and then copy the file I need (which is inside my source file) to the right directory inside the site-package directory of Python.
Unfortunately, even if the operation seems to be successful while building the image, the actual file hasn’t be copied.
My Docker file is below
# syntax=docker/dockerfile:1 FROM python:3.8-slim-buster WORKDIR /app COPY serial_find.py serial_find.py RUN pip install pyserial ADD list_ports_linux.py usr/local/lib/python3.8/site-packages/serial/tools/ CMD [ "python3", "./serial_find.py" ]
the folder containing the files for building the images has:
Am I using ADD in the wrong way? In the past, this solution worked