From 243326d8d19c03876ba6a037fcddfb7ebe8b0b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emek=20Vysok=C3=BD?= Date: Fri, 2 Dec 2022 15:12:56 +0100 Subject: [PATCH] Add instructions to build using Docker into VMR's README (#15073) Co-authored-by: Michael Simons --- .../content/eng/bootstrap/README.template.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md b/src/SourceBuild/tarball/content/eng/bootstrap/README.template.md index 3393b82b3..d092f1f4f 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 @@ -110,7 +111,7 @@ The dependencies for building .NET from source can be found [here](https://githu ```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-arch]/Release/dotnet-sdk-8.0.100-[your-RID].tar.gz -C $HOME/dotnet ln -s $HOME/dotnet/dotnet /usr/bin/dotnet ``` @@ -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 -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/x64/Release/dotnet-sdk-8.0.100-centos.8-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: