I am pretty new to Docker and I have to build a container that can run a Python script that sends messages periodically to an Azure IoT Hub using the rows of a CSV file. I have already built this container using Linux, but due to limitations of my resources, I must rebuild the image using a Windows container. This is the setup of my Dockerfile that I am attempting to use:
FROM mcr.microsoft.com/windows/servercore:1809
# Install pip requirements
ADD requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
ADD SimulatedDeviceFitbit.py .
WORKDIR /app
COPY sensor_original2.csv .
CMD ["python", "SimulatedDeviceFitbit.py"]
The only package added using Pip is the azure-iot-device library. The CSV is used to read the data that will be sent as a message and the script handles the sending of the message. Whenever I run the image, the error:
azure.iot.device.common.transport_exceptions.TlsExchangeAuthError: TlsExchangeAuthError(None) caused by SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')
The connection made to the IoT hub in the script looks like this:
client = IoTHubDeviceClient.create_from_connection_string(CONNECTION_STRING)
I checked my network devices through Docker and did not see any issues but obviously I am missing something. I have no experience networking in a container and would appreciate any guidance.