From 78d75c6d58eb6f5a1e1fd40b086827a03929d0c5 Mon Sep 17 00:00:00 2001 From: Premek Vysoky Date: Thu, 1 Dec 2022 14:20:35 +0100 Subject: [PATCH 1/3] Add instructions to build using Docker into VMR's README --- .../content/eng/bootstrap/README.template.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md b/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md index 3393b82b3182..51b3d1a5f462 100644 --- a/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md +++ b/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md @@ -75,6 +75,7 @@ For the latest information about Source-Build support, please watch for announce ### Prerequisites The dependencies for building .NET from source can be found [here](https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/linux-requirements.md). +In case you don't want to / cannot prepare your environment per the requirements, consider [using Docker](#building-using-docker). ### Building @@ -120,6 +121,20 @@ The dependencies for building .NET from source can be found [here](https://githu dotnet --info ``` +### Building using Docker + +You can also build the repository using a Docker image which has the required prerequisites inside. +The example below creates a Docker volume named `vmr` and clones and builds the VMR there. + +```sh +docker run --rm -itv vmr:/vmr -w /vmr mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8 +git clone https://github.com/dotnet/dotnet . +./prep.sh && ./build.sh --online +mkdir -p $HOME/.dotnet +tar -zxf artifacts/x64/Release/dotnet-sdk-8.0.100-x64.tar.gz -C $HOME/.dotnet +ln -s $HOME/.dotnet/dotnet /usr/bin/dotnet +``` + ## List of components To enable full offline source-building of the VMR, we have no other choice than to synchronize all the necessary code into the VMR. This also includes any code referenced via git submodules. More details on why and how this is done can be found here: From b171a3e85ad3f949a5cb2f4ceb4e9f5c9e4e5722 Mon Sep 17 00:00:00 2001 From: Premek Vysoky Date: Thu, 1 Dec 2022 14:22:16 +0100 Subject: [PATCH 2/3] Fix RID --- .../tarball/content/eng/bootstrap/README.template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md b/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md index 51b3d1a5f462..d570687ece18 100644 --- a/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md +++ b/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md @@ -111,7 +111,7 @@ In case you don't want to / cannot prepare your environment per the requirements ```bash mkdir -p $HOME/dotnet - tar zxf artifacts/x64/Release/dotnet-sdk-8.0.100-your-RID.tar.gz -C $HOME/dotnet + tar zxf artifacts/[your-RID]/Release/dotnet-sdk-8.0.100-[your-RID].tar.gz -C $HOME/dotnet ln -s $HOME/dotnet/dotnet /usr/bin/dotnet ``` @@ -131,7 +131,7 @@ docker run --rm -itv vmr:/vmr -w /vmr mcr.microsoft.com/dotnet-buildtools/prereq git clone https://github.com/dotnet/dotnet . ./prep.sh && ./build.sh --online mkdir -p $HOME/.dotnet -tar -zxf artifacts/x64/Release/dotnet-sdk-8.0.100-x64.tar.gz -C $HOME/.dotnet +tar -zxf artifacts/[your-RID]/Release/dotnet-sdk-8.0.100-[your-RID].tar.gz -C $HOME/.dotnet ln -s $HOME/.dotnet/dotnet /usr/bin/dotnet ``` From 098eb1ce4eef2d9e5154f0cdafe5f4622cfc57d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emek=20Vysok=C3=BD?= Date: Thu, 1 Dec 2022 16:35:25 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Michael Simons --- .../tarball/content/eng/bootstrap/README.template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md b/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md index d570687ece18..d092f1f4fcfa 100644 --- a/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md +++ b/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md @@ -111,7 +111,7 @@ In case you don't want to / cannot prepare your environment per the requirements ```bash mkdir -p $HOME/dotnet - tar zxf artifacts/[your-RID]/Release/dotnet-sdk-8.0.100-[your-RID].tar.gz -C $HOME/dotnet + tar zxf artifacts/[your-arch]/Release/dotnet-sdk-8.0.100-[your-RID].tar.gz -C $HOME/dotnet ln -s $HOME/dotnet/dotnet /usr/bin/dotnet ``` @@ -127,11 +127,11 @@ You can also build the repository using a Docker image which has the required pr The example below creates a Docker volume named `vmr` and clones and builds the VMR there. ```sh -docker run --rm -itv vmr:/vmr -w /vmr mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8 +docker run --rm -it -v vmr:/vmr -w /vmr mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8 git clone https://github.com/dotnet/dotnet . ./prep.sh && ./build.sh --online mkdir -p $HOME/.dotnet -tar -zxf artifacts/[your-RID]/Release/dotnet-sdk-8.0.100-[your-RID].tar.gz -C $HOME/.dotnet +tar -zxf artifacts/x64/Release/dotnet-sdk-8.0.100-centos.8-x64.tar.gz -C $HOME/.dotnet ln -s $HOME/.dotnet/dotnet /usr/bin/dotnet ```