All Projects → paketo-buildpacks → go-dist

paketo-buildpacks / go-dist

Licence: Apache-2.0 License
A Cloud Native Buildpack for Go

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Labels

Projects that are alternatives of or similar to go-dist

graalvm
A Cloud Native Buildpack that provides the GraalVM implementations of JREs and JDKs
Stars: ✭ 21 (+23.53%)
Mutual labels:  cnb
go
A Cloud Native Buildpack for Go
Stars: ✭ 53 (+211.76%)
Mutual labels:  cnb
ruby
No description or website provided.
Stars: ✭ 15 (-11.76%)
Mutual labels:  cnb
bellsoft-liberica
A Cloud Native Buildpack that provides the Bellsoft Liberica implementations of JREs and JDKs
Stars: ✭ 33 (+94.12%)
Mutual labels:  cnb
php
A Cloud Native Buildpack for PHP
Stars: ✭ 17 (+0%)
Mutual labels:  cnb
go-build
A Cloud Native Buildpack for compiling Go applications
Stars: ✭ 18 (+5.88%)
Mutual labels:  cnb
nodejs
A Cloud Native Buildpack for Node.JS
Stars: ✭ 29 (+70.59%)
Mutual labels:  cnb
dotnet-core
A Cloud Native Buildpack for .NET Core
Stars: ✭ 27 (+58.82%)
Mutual labels:  cnb
java
A Cloud Native Buildpack with an order definition suitable for Java applications
Stars: ✭ 66 (+288.24%)
Mutual labels:  cnb

Go Distribution Cloud Native Buildpack

The Go Distribution CNB provides the Go binary distribution that can be used to execute Go tooling. The buildpack installs the Go binary distribution onto the $PATH which makes it available for subsequent buildpacks. These buildpacks can then use that distribution to run Go tooling including building Go application binaries. Examples of buildpacks that perform this binary building process include the Go Mod CNB and the Dep CNB.

Integration

The Go Distribution CNB provides Go as a dependency. Downstream buildpacks, like Go Mod or Dep, can require the go dependency by generating a Build Plan TOML file that looks like the following:

[[requires]]

  # The name of the  dependency is "go". This value is considered
  # part of the public API for the buildpack and will not change without a plan
  # for deprecation.
  name = "go"

  # The version of the Go 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 "1.*", "1.13.*", or even
  # "1.13.9".
  version = "1.13.9"

  # The Go buildpack supports some non-required metadata options.
  [requires.metadata]

    # Setting the build flag to true will ensure that the Go
    # depdendency is available on the $PATH for subsequent buildpacks during
    # their build phase. If you are writing a buildpack that needs to run Go
    # during its build process, this flag should be set to true.
    build = true

    # Setting the launch flag to true will ensure that the Go
    # dependency is available on the $PATH for the running application. If you are
    # writing an application that needs to run Go at runtime, this flag should
    # be set to true.
    launch = 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.

Go Build Configuration

To configure the Go version, please use the BP_GO_VERSION environment variable at build time either directly (ex. pack build my-app --env BP_GO_VERSION=~1.14.1) or through a project.toml file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].