diff --git a/Makefile b/Makefile index 84b2bbc91..cb782b72a 100644 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ check-pack-cli-version: .PHONY: install-ugo install-ugo: @echo "> Installing ugo..." - cd tools; go install github.com/jromero/ugo/cmd/ugo@0.0.4 + cd tools; go install github.com/jromero/ugo/cmd/ugo@latest .PHONY: pack-docs-update pack-docs-update: upgrade-pack diff --git a/content/docs/for-platform-operators/tutorials/lifecycle/_index.md b/content/docs/for-platform-operators/tutorials/lifecycle/_index.md index d928ef250..9a69cbf4c 100644 --- a/content/docs/for-platform-operators/tutorials/lifecycle/_index.md +++ b/content/docs/for-platform-operators/tutorials/lifecycle/_index.md @@ -9,6 +9,24 @@ A `platform` orchestrates builds by invoking the [lifecycle][lifecycle] binary t + + + + + + + + The majority of Buildpack users use community-maintained platforms, such as [pack][pack] and [kpack][kpack], to run Buildpacks and create `OCI images`. However this might not be desireable especially for users maintaining their own platforms and seeking more control over how the underlying Buildpack `lifecycle phases` are executed. > This tutorial is derived from a [blog post][blog post] contributed by one of our community members. @@ -44,6 +62,14 @@ As a starting step, you need to build the `lifecycle` in order to use its phases * `make build-linux-amd64` for `AMD64` architectures (for Linux users) * `make build-darwin-arm64 && make build-linux-arm64-launcher` for `ARM64` architectures (for Mac users) + + + It's recommended to check the [lifecycle releases][releases] page to download binaries based on your system. > Please note that the entire process is most easily followed on Linux systems @@ -51,7 +77,7 @@ It's recommended to check the [lifecycle releases][releases] page to download bi In order to execute the various `lifecycle phases` correctly, you first need to set the values of few important environment variables by running the following commands in the terminal: -```text +```command export CNB_USER_ID=$(id -u) CNB_GROUP_ID=$(id -g) CNB_PLATFORM_API=0.14 export CNB_SAMPLES_PATH="//samples" export CNB_LIFECYCLE_PATH="//lifecycle" @@ -86,8 +112,9 @@ The `analyze` phase runs before the `detect` phase in order to validate registry Prior to executing `/cnb/lifecycle/analyzer`, you need to create a parent directory for this tutorial and two other directories inside it as follows: -```text -mkdir /tmp/tutorial # or your preferred directory + +```command +mkdir -p /tmp/tutorial # or your preferred directory cd /tmp/tutorial mkdir -p apps/bash-script mkdir -p layers @@ -98,16 +125,32 @@ mkdir -p layers Next, you need to copy the `bash-script` samples into our `apps/bash-script` directory, which will host our app's source code. -```text +```command cp -r "${CNB_SAMPLES_PATH}/apps/bash-script" ./apps/ ``` + + + Now, you can invoke the `analyzer` for `AMD64` architecture ```text ${CNB_LIFECYCLE_PATH}/analyzer -log-level debug -daemon -layers="./layers" -run-image cnbs/sample-stack-run:noble apps/bash-script ``` + + + Or if you are on an `ARM64` platform ```text @@ -130,13 +173,15 @@ Now the `analyzer`: In this tutorial, there is no previous `apps/bash-script` image, and the output produced should be similar to the following: + ```text -sample-stack-run:noble apps/bash-script + +... Starting analyzer... Parsing inputs... Ensuring privileges... Executing command... -Timer: Analyzer started at 2024-09-30T07:38:14Z +... Image with name "apps/bash-script" not found Image with name "cnbs/sample-stack-run:noble" not found Timer: Analyzer ran for 41.92µs and ended at 2024-09-30T07:38:14Z