Closed Lazer91 closed 1 year ago
Do the libplctag core binaries work by themself for this setup?
They might not. You'll probably need to build them using the musl libraries.
Indeed we solved by building the native library in an Alpine VM. Here are the commands if anyone is interested:
apk update
apk add build-base gcc git cmake
git clone https://github.com/libplctag/libplctag.git
cd libplctag
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
Please note that:
libplctag.so
that you will find in the output directory is just a 0 byte symbolic link. You will need to find the file it is pointing to (for example libplctag.so.2.5
) and rename it to libplctag.so
, then include it in your .NET solution with the "Copy always" action set.plctag.ForceExtractLibrary = false;
I'm struggling to make this work inside an Alpine-based .NET docker image, due to the dependency on
glibc
. Here's what I tried:This works (it's Debian)
This doesn't work,
glibc
is missing in AlpineI tried to add
gcompact
as per THIS but doesn't work (segmentation fault as soon as the lib is invoked in MyApp)I tried also sgerrand/alpine-pkg-glibc:
but it doesn't work, I get THIS issue.
Has anyone managed to make this work in an Alpine image? I read that it's not recommended to use
glibc
in Alpine due to the presence ofmusl
.