Vikash Rathee
Vikash Rathee

Reputation: 2094

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

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

Upvotes: 2

Views: 1858

Answers (2)

a7md0
a7md0

Reputation: 447

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
...

Upvotes: 3

Marcin
Marcin

Reputation: 238507

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

Upvotes: 6

Related Questions