C
C#2mo ago
snakex64

.NET Runtime Docker build tools missing openssl

Hi, I am trying to build a modified .net runtime using docker and I get the following error: Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) I cloned the repo locally and ran this : docker run --rm -v (my windows path here):/runtime -w /runtime mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64 ./build.sh --subset clr --configuration Checked. Anyone has an idea ? I would ultimately like to be able to install the modified version so I can try a bugfix in my project
No description
11 Replies
felsokning
felsokning2mo ago
Maybe the image needs openssl1.1? Think openssl3.0 is the default on newer images and doesn't map the same (if I recall, correctly). https://launchpad.net/ubuntu/+source/openssl/1.1.1f-1ubuntu2.23
snakex64
snakex64OP2mo ago
it's weird if I need to play with the image to work, it's custom made to build .net from source 😅
felsokning
felsokning2mo ago
Same issue with ubuntu-24.04-helix-amd64
No description
snakex64
snakex64OP2mo ago
hm that's a good question! I can't seem to be able to build it locally, was hoping the container would fix that issue... supposed to be the whole freakin point of docker is that it's repeatable for everyone 😅
felsokning
felsokning2mo ago
So far, just seems to have been two packages it was missing - but the build containers definitely aren't all 2legit2quit for this.
No description
felsokning
felsokning2mo ago
Build succeeded; just a painfully slow export.
No description
felsokning
felsokning2mo ago
My dockerfile contents, if you want to just build without sorting package dependencies:
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-helix-amd64 AS buildtools

RUN whoami \
&& sudo apt-get update \
&& sudo apt-get install libkrb5-dev liblttng-ust-dev -y \
&& sudo git clone https://github.com/dotnet/dotnet dotnet-dotnet \
&& cd dotnet-dotnet \
&& sudo ./build.sh --clean-while-building
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-helix-amd64 AS buildtools

RUN whoami \
&& sudo apt-get update \
&& sudo apt-get install libkrb5-dev liblttng-ust-dev -y \
&& sudo git clone https://github.com/dotnet/dotnet dotnet-dotnet \
&& cd dotnet-dotnet \
&& sudo ./build.sh --clean-while-building
NOTE: If you want to build from a release tag, the steps are little more involved. To build from a tag, you'd have to do this:
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-helix-amd64 AS buildtools

RUN whoami \
&& sudo apt-get update \
&& sudo apt-get install libkrb5-dev liblttng-ust-dev -y \
&& sudo git clone https://github.com/dotnet/dotnet --branch v8.0.10 --single-branch \
&& cd dotnet \
&& sudo ./prep.sh \
&& sudo ./build.sh --clean-while-building
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-24.04-helix-amd64 AS buildtools

RUN whoami \
&& sudo apt-get update \
&& sudo apt-get install libkrb5-dev liblttng-ust-dev -y \
&& sudo git clone https://github.com/dotnet/dotnet --branch v8.0.10 --single-branch \
&& cd dotnet \
&& sudo ./prep.sh \
&& sudo ./build.sh --clean-while-building
snakex64
snakex64OP2mo ago
damn, NICE! You're amazing 🙌. I sadly have to work an entire day before I can fiddle with it. I'll see later today if it works I'll just mount a volume again like in my original command Coudn't wait 😐 It does work. At least I can run all the unit tests like that too. Do you know if I can use that setup to create the SDK installer / use that runtime in VS ? I changed the "runtime" not the "dotnet" repo. It would be easier to actually install it so I can use it normally with VS without working in dev containers since I do desktop apps that manipulate a lot of stuff on the PC that I don't really wanna go through containers when debugging
felsokning
felsokning2mo ago
On a dev machine, you'd just unpack it into the target folder -- but you should use a separate machine (e.g.: Hyper-V, VMWare, etc.) to not mux your .NET build with distributed binaries via the supported channels (e.g.: Windows updates might freak about binary signatures not matching).
mkdir %userprofile%\dotnet
tar -xf artifacts/assets/Release/dotnet-sdk-9.0.100-[your RID].zip -C %userprofile%\dotnet
set "PATH=%userprofile%\dotnet;%PATH%"
mkdir %userprofile%\dotnet
tar -xf artifacts/assets/Release/dotnet-sdk-9.0.100-[your RID].zip -C %userprofile%\dotnet
set "PATH=%userprofile%\dotnet;%PATH%"
snakex64
snakex64OP2mo ago
oh that easy, gotcha!
Want results from more Discord servers?
Add your server