diff --git a/Docker/linux-arm32/Dockerfile b/Docker/linux-arm32/Dockerfile index aad9811..3b8f23e 100644 --- a/Docker/linux-arm32/Dockerfile +++ b/Docker/linux-arm32/Dockerfile @@ -15,6 +15,6 @@ ARG EXE_DIR=. WORKDIR /app COPY $EXE_DIR/ ./ -COPY --from=build-env /app/libcomWrapper.so /lib/arm-linux-gnueabihf/ +COPY --from=build-env /app/libcomWrapper.so /usr/lib/ CMD ["/usr/bin/dotnet", "iot-edge-modbus.dll"] \ No newline at end of file diff --git a/Docker/linux-arm32/Dockerfile-auto b/Docker/linux-arm32/Dockerfile-auto index aad9811..a08df6e 100644 --- a/Docker/linux-arm32/Dockerfile-auto +++ b/Docker/linux-arm32/Dockerfile-auto @@ -15,6 +15,6 @@ ARG EXE_DIR=. WORKDIR /app COPY $EXE_DIR/ ./ -COPY --from=build-env /app/libcomWrapper.so /lib/arm-linux-gnueabihf/ +COPY --from=build-env /app/libcomWrapper.so /usr/lib CMD ["/usr/bin/dotnet", "iot-edge-modbus.dll"] \ No newline at end of file diff --git a/Docker/linux-x64/Dockerfile b/Docker/linux-x64/Dockerfile index b05f3d7..c224940 100644 --- a/Docker/linux-x64/Dockerfile +++ b/Docker/linux-x64/Dockerfile @@ -15,6 +15,6 @@ ARG EXE_DIR=. WORKDIR /app COPY $EXE_DIR/ ./ -COPY --from=build-env /app/libcomWrapper.so /lib/x86_64-linux-gnu/ +COPY --from=build-env /app/libcomWrapper.so /usr/lib/ CMD ["/usr/bin/dotnet", "iot-edge-modbus.dll"] \ No newline at end of file diff --git a/Docker/linux-x64/Dockerfile-auto b/Docker/linux-x64/Dockerfile-auto index 53a7e4b..4b70f4c 100644 --- a/Docker/linux-x64/Dockerfile-auto +++ b/Docker/linux-x64/Dockerfile-auto @@ -24,6 +24,6 @@ FROM microsoft/dotnet:2.0.0-runtime WORKDIR /app COPY --from=build-env /app/out ./ -COPY --from=build-env-2 /app/libcomWrapper.so /lib/x86_64-linux-gnu/ +COPY --from=build-env-2 /app/libcomWrapper.so /usr/lib/ CMD ["/usr/bin/dotnet", "iot-edge-modbus.dll"] \ No newline at end of file diff --git a/README.md b/README.md index 4c9d270..52d52ef 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ $dotnet restore $dotnet build $dotnet publish -f netcoreapp2.0 -c Release $cd ../ -$docker build --build-arg EXE_DIR=./src/bin/Release/netcoreapp2.0/publish -t "modbus:latest" -f Docker//Dockerfile . +$docker build --build-arg EXE_DIR=./src/bin/release/netcoreapp2.0/publish -t "modbus:latest" -f Docker//Dockerfile . ``` ## Configuration ## diff --git a/src/ComWrapper.cs b/src/ComWrapper.cs index 3f33819..9b6bfeb 100644 --- a/src/ComWrapper.cs +++ b/src/ComWrapper.cs @@ -43,25 +43,25 @@ namespace tempSerialPort } } - [DllImport("comWrapper")] + [DllImport("libcomWrapper.so")] public static extern int com_open(string pathname); - [DllImport("comWrapper")] + [DllImport("libcomWrapper.so")] public static extern int com_close(int fd); - [DllImport("comWrapper")] + [DllImport("libcomWrapper.so")] public static extern int com_read(int fd, IntPtr buf, int count); - [DllImport("comWrapper")] + [DllImport("libcomWrapper.so")] public static extern int com_write(int fd, IntPtr buf, int count); - [DllImport("comWrapper")] + [DllImport("libcomWrapper.so")] public static extern int com_tciflush(int fd); - [DllImport("comWrapper")] + [DllImport("libcomWrapper.so")] public static extern int com_tcoflush(int fd); - [DllImport("comWrapper")] + [DllImport("libcomWrapper.so")] public static extern int com_set_interface_attribs(int fd, int speed, int data_bits, int parity_bit, int stop_bit); } } \ No newline at end of file