AWS Codebuild: Unknown runtime version named '5.0' of dotnet

Viewed 1360

I have my ASP.net core API targeting Dot net 5.0. Is anyone successful in deploying a dotnet 5 application on Amazon Linux platform using CI/CD approach with AWS CodeBuild?

I tried to use dotnet latest which resolve to version 3.1. And, when I use the 5.0 in buildspec.yml, it errors. As per the blog, it seems to be supported. But not sure how to install using buildspec.yml.

phases:   
  install:
    runtime-versions:
      dotnet: 5.0

aws error

2 Answers

It is not yet supported. From the blog linked:

Support for targeting .NET 5 in AWS CodeBuild is coming soon.

There is also more recent github issue showing that you can build your own custom image for CB, for dotnet:5.0.

The latest supported version is dotnet 3.1

Apparently it's supported since January 8, 2021 (source)

Using the following environment for CodeBuild does work to build .NET 5 applications:

  • Managed image
  • Operating system: Ubuntu
  • Runtime: Standard
  • Image: aws/codebuild/standard:5.0
  • Imager version: Always use the latest image for this runtime version
  • Environment type: Linux

Meanwhile in the buildspec.yml

version: 0.2

phases:
  install:
    runtime-versions:
      dotnet: latest
...
Related