Closed jwshyns closed 7 months ago
The default version of .NET in the latest CodeBuild image is 6.0. We have released a change to ensure the default version is set properly. We have now added .NET 8 to our latest image and you no longer need to install it manually. Please use the buildspec property phases/install/runtime-versions to select your preferred version of dotnet. See documentation here: https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec.phases.install
By default dotnet uses the latest version available. To set 6.0 as the default dotnet, we create a global.json file at the CodeBuild root directory(/codebuild) during the image build. The image previously did not have a global.json, and this global.json will apply to all subdirectories. To override this, a customer can select dotnet 8 in the buildspec which will create a new global.json file in the source directory(/codebuild/output/src), generate a global.json as part of their buildspec, or provide one in the source themselves. This will override the default global.json(in /codebuild) for the src directory. This allows us to have 6.0 as the default dotnet and allows customers to choose to use dotnet 8.0 if they choose to.
As mentioned the workaround will allow you to use the dotnet version you specify.
Describe the bug Closing this PR has resulted in existing usages of
aws/codebuild/amazonlinux2-aarch64-standard:3.0
and dotnet 7 to be broken.To Reproduce Steps to reproduce the behavior:
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel STS
as demonstrated here .Expected behavior Dotnet commands will be run using the CLI version that was explicitly installed.
Logs
Platform (please complete the following information):
Additional context I've implemented a workaround similar to how the updates forcibly set the dotnet version (
dotnet new globaljson --force --sdk-version <version here> --roll-forward feature
) - I just thought I'd report the issue.