A Cloud Foundry buildpack for running arbitrary binary web servers.
Official buildpack documentation can be found at binary buildpack docs.
To build this buildpack, run the following command from the buildpack's directory:
-
Source the .envrc file in the buildpack directory.
source .envrcTo simplify the process in the future, install direnv which will automatically source .envrc when you change directories.
-
Install buildpack-packager
go install github.com/cloudfoundry/libbuildpack/packager/buildpack-packager
-
Build the buildpack
buildpack-packager build [ --cached=(true|false) ]
-
Use in Cloud Foundry
Upload the buildpack to your Cloud Foundry and optionally specify it by name
cf create-buildpack [BUILDPACK_NAME] [BUILDPACK_ZIP_FILE_PATH] 1 cf push my_app [-b BUILDPACK_NAME]
Buildpacks use the Cutlass framework for running integration tests.
To test this buildpack, run the following command from the buildpack's directory:
-
Source the .envrc file in the buildpack directory.
source .envrcTo simplify the process in the future, install direnv which will automatically source .envrc when you change directories.
-
Run unit tests
./scripts/unit.sh
-
Run integration tests
./scripts/integration.sh
This buildpack can automatically inject the Dynatrace OneAgent into your application. When a Dynatrace service is bound to the app, the buildpack downloads the OneAgent during staging and configures LD_PRELOAD (via profile.d/dynatrace-env.sh) so the agent is loaded into your binary at launch.
Bind a Dynatrace user-provided service (the service name must contain dynatrace):
cf create-user-provided-service dynatrace -p '{"environmentid":"<env-id>","apitoken":"<paas-token>"}'
cf bind-service my_app dynatrace
cf restage my_appSupported credential fields:
| Key | Type | Description | Required | Default |
|---|---|---|---|---|
| environmentid | string | The ID for the Dynatrace environment. | Yes | N/A |
| apitoken | string | The API Token for the Dynatrace environment. | Yes | N/A |
| apiurl | string | Overrides the default Dynatrace API URL to connect to. | No | Default API URL |
| skiperrors | boolean | If true, staging does not fail when the OneAgent download fails. |
No | false |
| networkzone | string | If set, the agent is configured to use communication endpoints located in this network zone. | No | empty |
| enablefips | boolean | If true, FIPS 140-2 mode is enabled. |
No | false |
| addtechnologies | string | Comma-separated list of additional OneAgent code modules to download (e.g. go, java, nodejs). |
No | empty |
By default the buildpack downloads the generic process code module. Since the
binary buildpack runs an opaque binary, it cannot detect the application's
language. For language-specific code-level insights, set addtechnologies
accordingly — e.g. "addtechnologies":"go" for a Go binary. Note that OneAgent
injection relies on LD_PRELOAD, so the binary must be dynamically linked
(for Go, built with CGO_ENABLED=1); a fully statically-linked binary ignores
LD_PRELOAD and will not be instrumented.
Find our guidelines here.
Join the #buildpacks channel in our Slack community if you need any further assistance.
Open a GitHub issue on this project here.