Skip to content

Ubuntu Standard 5.0 .NET Core Tools fail because DOTNET_ROOT is not configured #418

@cristeh

Description

@cristeh

Hi. We're experimenting with .NET 5 and use GitVersion.Tool as part of of our pipeline which is a global .NET Core executable.
Since the Standard 5.0 doesn't have a DOTNET_ROOT env var(seems like it's set as an ARG in https://github.com/aws/aws-codebuild-docker-images/blob/master/ubuntu/standard/5.0/Dockerfile#L162) the way Standard 4.0 does(

ENV DOTNET_ROOT="/root/.dotnet"
), we get the following error:
A fatal error occurred. The required library libhostfxr.so could not be found. If this is a self-contained application, that library should exist in [/codebuild/output/src768222049/src/github.com/[...]/.store/gitversion.tool/5.6.4/gitversion.tool/5.6.4/tools/net5.0/any/]. If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet/install_location].

An workaround is to add it by hand in the buildscript.yml file, in which case everything works:
env: variables: DOTNET_ROOT: /root/.dotnet
but this is obviously not ideal.
Is it possible for Standard 5.0 to work like the older images in this regard?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions