/dotnet-core-sdk

Primary LanguageGoApache License 2.0Apache-2.0

.NET Core SDK Cloud Native Buildpack

The .NET Core SDK CNB provides a version of the .NET Core SDK and a version of the .NET Core Driver or the dotnet binary. It also sets the .NET Core SDK on the$DOTNET_ROOT so that it is available to subsequent buildpacks during their build phase and sets the .NET Core Driver on the $PATH so that is available to subsequent buildpacks and in the final running container.

Integration

The .NET Core SDK CNB provides the dotnet-sdk as a dependency. Downstream buildpacks, like .NET Core Build can require the dotnet-sdk dependency by generating a Build Plan TOML file that looks like the following:

[[requires]]

  # The name of the .NET Core SDK dependency is "dotnet-sdk". This value is considered
  # part of the public API for the buildpack and will not change without a plan
  # for deprecation.
  name = "dotnet-sdk"

  # The version of the .NET Core SDK dependency is not required. In the case it
  # is not specified, the buildpack will provide the default version, which can
  # be seen in the buildpack.toml file.
  # If you wish to request a specific version, the buildpack supports
  # specifying a semver constraint in the form of "3.*", "3.1.*", or even
  # "3.1.100".
  version = "3.1.100"

  # The .NET Core SDK buildpack supports some non-required metadata options.
  [requires.metadata]

    # Setting the build flag to true will ensure that the .NET Core SDK
    # depdendency is available in the $DOTNET_ROOT for subsequent buildpacks during
    # their build phase and ensures that the .NET Core Driver dependency is available
    # in the $PATH for subsequent buildpacks. If you are writing a buildpack that needs
    # to use the dotnet sdk & driver during its build process, this flag should be set
    # to true.
    build = true

Usage

To package this buildpack for consumption:

$ ./scripts/package.sh

This builds the buildpack's Go source using GOOS=linux by default. You can supply another value as the first argument to package.sh.

(Deprecated) buildpack.yml Configurations

dotnet-sdk:
  # this allows you to specify a version constaint for the dotnet-sdk dependency
  # any valid semver constaints (e.g. 2.* and 2.1.*) are also acceptable
  version: "2.1.804"

This configuration option will be deprecated with the next major version release of the buildpack. Because the versions of the .NET Core runtime and .NET Core SDK are so tightly coupled, most users should instead use the $BP_DOTNET_FRAMEWORK_VERSION environment variable to specify which version of the .NET Core runtime that the Paketo .NET Core Runtime Buildpack should install. This buildpack will automatically select an SDK version to install that is compatible with the selected .NET Core runtime version.