### Example Build Output with Custom APT Configuration Source: https://paketo.io/docs/howto/configuration This output demonstrates the build process after adding a custom APT repository and key. It shows the steps of importing keys, adding repositories, updating apt caches, and installing packages. ```text [builder] -----> Detected Aptfile changes, flushing cache [builder] -----> Importing custom GPG keys [builder] Fetching key from https://dl.yarnpkg.com/debian/pubkey.gpg [builder] Reading key from file /tmp/tmp.EMiAzTogy4 [builder] Successfully imported key [builder] -----> Adding custom repositories [builder] -----> Updating apt caches [builder] Get:1 https://dl.yarnpkg.com/debian stable InRelease [builder] Get:2 https://dl.yarnpkg.com/debian stable/main arm64 Packages [11.8 kB] [builder] Hit:3 http://ports.ubuntu.com/ubuntu-ports jammy InRelease [builder] Get:4 https://dl.yarnpkg.com/debian stable/main all Packages [11.8 kB] [builder] Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [builder] Hit:6 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [builder] Fetched 40.6 kB in 0s (91.8 kB/s) [builder] Reading package lists... [builder] -----> Fetching .debs for yarn [builder] Reading package lists... [builder] Building dependency tree... [builder] The following additional packages will be installed: [builder] javascript-common libc-ares2 libicu70 libjs-highlight.js libnode72 libuv1 [builder] nodejs nodejs-doc [builder] Suggested packages: [builder] apache2 | lighttpd | httpd npm [builder] The following NEW packages will be installed: [builder] javascript-common libc-ares2 libicu70 libjs-highlight.js libnode72 libuv1 [builder] nodejs nodejs-doc yarn [builder] 0 upgraded, 9 newly installed, 0 to remove and 6 not upgraded. [builder] Need to get 24.7 MB of archives. [builder] After this operation, 91.8 MB of additional disk space will be used. [builder] Get:1 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libicu70 arm64 70.1-2 [10.5 MB] [builder] Get:2 https://dl.yarnpkg.com/debian stable/main arm64 yarn all 1.22.22-1 [896 kB] [builder] Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 libuv1 arm64 1.43.0-1ubuntu0.1 [90.1 kB] [builder] Get:4 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 javascript-common all 11+nmu1 [5936 B] [builder] Get:5 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 libjs-highlight.js all 9.18.5+dfsg1-1 [367 kB] [builder] Get:6 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 libc-ares2 arm64 1.18.1-1ubuntu0.22.04.3 [44.6 kB] [builder] Get:7 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 libnode72 arm64 12.22.9~dfsg-1ubuntu3.6 [10.3 MB] [builder] Get:8 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 nodejs-doc all 12.22.9~dfsg-1ubuntu3.6 [2411 kB] [builder] Get:9 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 nodejs arm64 12.22.9~dfsg-1ubuntu3.6 [122 kB] [builder] Fetched 24.7 MB in 1s (17.9 MB/s) [builder] Download complete and in download only mode [builder] -----> Installing apt packages with dpkg [builder] javascript-common_11+nmu1_all.deb [builder] libc-ares2_1.18.1-1ubuntu0.22.04.3_arm64.deb [builder] libicu70_70.1-2_arm64.deb [builder] libjs-highlight.js_9.18.5+dfsg1-1_all.deb [builder] libnode72_12.22.9~dfsg-1ubuntu3.6_arm64.deb [builder] libuv1_1.43.0-1ubuntu0.1_arm64.deb [builder] nodejs-doc_12.22.9~dfsg-1ubuntu3.6_all.deb [builder] nodejs_12.22.9~dfsg-1ubuntu3.6_arm64.deb [builder] yarn_1.22.22-1_all.deb [builder] -----> Writing environment variables [builder] PATH=/layers/paketo-buildpacks_apt/apt/usr/bin ``` -------------------------------- ### Aptfile for Package Installation Source: https://paketo.io/docs/howto/configuration Create an Aptfile in your workspace root to list packages for installation. Each package should be on a new line. ```bash mysql-client ``` -------------------------------- ### Buildpack Build Logic Example Source: https://paketo.io/docs/howto/create-paketo-buildpack This Go code snippet demonstrates the build logic for a Paketo buildpack, including downloading and extracting a dependency. ```go package main import ( "fmt" "os" "os/exec" "path/filepath" ``` ```go ``` ```go "github.com/paketo-buildpacks/packit/v2" ) func main() { packit.Run(func(context packit.BuildContext) ( packit.BuildResult, err ) { nodeLayer := packit.Layer{Name: "node", Path: "/layers/node"} nodeLayer.Launch = true downloadDir, err := os.MkdirTemp("", "downloadDir") if err != nil { return packit.BuildResult{}, err } defer os.RemoveAll(downloadDir) fmt.Println("Downloading dependency...") err = exec.Command("curl", uri, "-o", filepath.Join(downloadDir, "node.tar.xz"), ).Run() if err != nil { return packit.BuildResult{}, err } fmt.Println("Untaring dependency...") err = exec.Command("tar", "-xf", filepath.Join(downloadDir, "node.tar.xz"), "--strip-components=1", "-C", nodeLayer.Path, ).Run() if err != nil { return packit.BuildResult{}, err } return packit.BuildResult{ Plan: context.Plan, Layers: []packit.Layer{ nodeLayer, }, }, nil }) } ``` -------------------------------- ### Yarn Start Command Source: https://paketo.io/docs/reference/nodejs-reference If the Node.js buildpack uses yarn to install packages, the start command is 'yarn start'. ```bash yarn start ``` -------------------------------- ### Provide Custom Start Command for Java App Source: https://paketo.io/docs/howto/java Override the default buildpack start command by setting the container ENTRYPOINT. This example starts an interactive Bash shell. ```shell docker run --rm --entrypoint bash samples/java ``` -------------------------------- ### Node.js Start Command with npm or yarn Source: https://paketo.io/docs/reference/nodejs-reference If the Node.js buildpack uses npm or yarn to install packages, the start command is generated from the contents of package.json. ```bash node ``` -------------------------------- ### Clone Samples Repository Source: https://paketo.io/docs/howto/app-monitor Clone the Paketo samples repository and navigate to the Java sample application directory to run the examples. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples/java ``` -------------------------------- ### Clone Paketo Samples Repository Source: https://paketo.io/docs/howto/configuration Clone the Paketo samples repository to access sample applications for configuration examples. This is a prerequisite for running the subsequent examples. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples ``` -------------------------------- ### Extend a Paketo Builder with a Dockerfile Source: https://paketo.io/docs/howto/builders Extend an existing Paketo builder by creating a Dockerfile. This example shows how to install additional packages like `git` into the builder environment. Note that these packages are not available at runtime. ```bash cat > builder.Dockerfile << EOF # pick a Paketo builder that suits your needs FROM paketobuildpacks/builder-jammy-base:latest # use the root user to enable privileged actions USER 0:0 # install packages RUN apt-get update && apt-get install \ -y --no-install-recommends \ git && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # switch back to the cnb user to prevent # consumers from executing privileged actions USER cnb EOF docker build -t my-builder-image -f builder.Dockerfile . ``` -------------------------------- ### Clone Paketo Samples Source: https://paketo.io/docs/howto/go Clone the Paketo samples repository to access example Go applications. Navigate to a Go sample app directory. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples/go/mod ``` -------------------------------- ### Build a Sample Python App Source: https://paketo.io/docs/howto/python Use the `pack` CLI to build a sample Python application with the Paketo Python Buildpack. Ensure you have the `pack` CLI installed and are in the sample app's directory. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples/python/pip pack build my-app --buildpack paketo-buildpacks/python \ --builder paketobuildpacks/builder-jammy-base ``` -------------------------------- ### View Build Output Source: https://paketo.io/docs This is an example of the output you can expect when building an app image with Paketo Buildpacks. It details the detection, analysis, building, and exporting phases. ```text ===> DETECTING 7 of 11 buildpacks participating paketo-buildpacks/ca-certificates 2.3.2 paketo-buildpacks/dotnet-core-runtime 0.1.12 paketo-buildpacks/dotnet-core-aspnet 0.1.12 paketo-buildpacks/dotnet-core-sdk 0.1.10 paketo-buildpacks/icu 0.0.102 paketo-buildpacks/dotnet-publish 0.3.0 paketo-buildpacks/dotnet-execute 0.4.0 ===> ANALYZING Previous image with name "paketo-demo-app" not found ===> RESTORING ===> BUILDING Paketo CA Certificates Buildpack 2.3.2 https://github.com/paketo-buildpacks/ca-certificates Launch Helper: Contributing to layer Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper Paketo .NET Core Runtime Buildpack 0.1.12 Resolving Dotnet Core Runtime version Candidate version sources (in priority order): aspnet.csproj -> "3.1.0" -> "" No exact version match found; attempting version roll-forward Selected dotnet-runtime version (using aspnet.csproj): 3.1.16 Executing build process Installing Dotnet Core Runtime 3.1.16 Completed in 7.304s Configuring environment for build and launch DOTNET_ROOT -> "/workspace/.dotnet_root" Configuring environment for build RUNTIME_VERSION -> "3.1.16" Paketo ASP.NET Core Buildpack 0.1.12 Resolving Dotnet Core ASPNet version Candidate version sources (in priority order): RUNTIME_VERSION -> "3.1.16" aspnet.csproj -> "3.1.0" -> "" Selected dotnet-aspnetcore version (using RUNTIME_VERSION): 3.1.16 Executing build process Installing Dotnet Core ASPNet 3.1.16 Completed in 2.582s Configuring environment DOTNET_ROOT -> "/workspace/.dotnet_root" Paketo .NET Core SDK Buildpack 0.1.10 Resolving .NET Core SDK version Candidate version sources (in priority order): RUNTIME_VERSION -> "3.1.410" -> "*" aspnet.csproj -> "3.1.*" Selected .NET Core SDK version (using RUNTIME_VERSION): 3.1.410 Executing build process Installing .NET Core SDK 3.1.410 Completed in 14.08s Configuring environment DOTNET_ROOT -> "/workspace/.dotnet_root" PATH -> "/workspace/.dotnet_root:$PATH" Paketo ICU Buildpack 0.0.102 Executing build process Installing ICU Completed in 2.56s Paketo .NET Publish Buildpack 0.3.0 Executing build process Running 'dotnet publish /workspace --configuration Release --runtime ubuntu.18.04-x64 --self-contained false --output /tmp/dotnet-publish-output295991778' Completed in 5.2121426s Removing source code Paketo .NET Execute Buildpack 0.4.0 Assigning launch processes web: /workspace/aspnet --urls http://0.0.0.0:${PORT:-8080} ===> EXPORTING Adding layer 'paketo-buildpacks/ca-certificates:helper' Adding layer 'paketo-buildpacks/dotnet-core-runtime:dotnet-core-runtime' Adding layer 'paketo-buildpacks/dotnet-core-aspnet:dotnet-core-aspnet' Adding layer 'paketo-buildpacks/dotnet-core-sdk:dotnet-env-var' Adding layer 'paketo-buildpacks/icu:icu' Adding 1/1 app layer(s) Adding layer 'launcher' Adding layer 'config' Adding layer 'process-types' Adding label 'io.buildpacks.lifecycle.metadata' Adding label 'io.buildpacks.build.metadata' Adding label 'io.buildpacks.project.metadata' Setting default process type 'web' Saving paketo-demo-app... *** Images (4c1b1f739e63): paketo-demo-app Adding cache layer 'paketo-buildpacks/dotnet-core-runtime:dotnet-core-runtime' Adding cache layer 'paketo-buildpacks/dotnet-core-aspnet:dotnet-core-aspnet' Adding cache layer 'paketo-buildpacks/dotnet-core-sdk:dotnet-core-sdk' Adding cache layer 'paketo-buildpacks/icu:icu' Successfully built image paketo-demo-app ``` -------------------------------- ### Buildpack Detection and Build Output Example Source: https://paketo.io/docs/concepts/buildpacks This output shows the detection and build phases of Paketo buildpacks for a Node.js application. It indicates which buildpacks were detected and their respective versions. ```bash ... ===> DETECTING paketo-buildpacks/node-engine 0.1.1 paketo-buildpacks/npm-install 0.2.0 paketo-buildpacks/npm-start 0.0.2 ... ===> BUILDING Paketo Node Engine Buildpack 0.1.1 ... Paketo NPM Install Buildpack 0.2.0 ... Paketo NPM Start Buildpack 0.0.2 ... ``` -------------------------------- ### Set Composer Install Options Source: https://paketo.io/docs/howto/php Define command-line options for 'composer install' by setting the BP_COMPOSER_INSTALL_OPTIONS environment variable. This allows for custom installation behaviors. ```bash pack build my-app --buildpack paketo-buildpacks/php \ --env BP_COMPOSER_INSTALL_OPTIONS="--no-dev --prefer-install=auto" ``` -------------------------------- ### Install DEB File from URL Source: https://paketo.io/docs/howto/configuration Specify the URL of a DEB file in the Aptfile to have it installed directly during the build process. ```bash http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-precise-amd64.deb ``` -------------------------------- ### HTTPD Basic Authentication Setup Source: https://paketo.io/docs/howto/web-servers Configure basic authentication for the HTTPD server by providing credentials via a service binding of type 'htpasswd' containing a .htpasswd file. ```text binding └── type └── .htpasswd ``` -------------------------------- ### Define a Default Process with Procfile Source: https://paketo.io/docs/howto/configuration This example demonstrates how to create a Procfile to define a custom process type and set it as the default for a Node.js application. ```shell echo "hello: echo hello world" > nodejs/yarn/Procfile pack build samples/nodejs \ --path nodejs/yarn \ --buildpack paketo-buildpacks/nodejs \ --buildpack paketo-buildpacks/procfile \ --default-process hello docker run samples/nodejs # should print "hello world" ``` -------------------------------- ### Clone Paketo Sample Applications Repository Source: https://paketo.io/docs/howto/java Clones the Paketo sample applications repository and navigates into the samples directory. This is used as the working directory for subsequent examples. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples ``` -------------------------------- ### Building an Image with Apt and Nginx Buildpacks Source: https://paketo.io/docs/howto/configuration Use `pack build` with specified buildpacks to create an application image. The Apt buildpack will read the Aptfile and install dependencies. ```bash > pack build apps/nginx --buildpack paketo-buildpacks/apt --buildpack paketo-buildpacks/nginx 500a46ce47c1: Already exists ... f5c5ce644ef6: Download complete ===> ANALYZING [analyzer] Image with name "apps/nginx" not found ===> DETECTING [detector] target distro name/version labels not found, reading /etc/os-release file [detector] paketo-buildpacks/apt 0.1.0 [detector] paketo-buildpacks/nginx 1.0.11 ===> RESTORING ===> BUILDING [builder] target distro name/version labels not found, reading /etc/os-release file [builder] -----> Detected Aptfile changes, flushing cache [builder] -----> Updating apt caches [builder] Get:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease [270 kB] [builder] Get:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [128 kB] [builder] Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [129 kB] [builder] Get:4 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 Packages [17.2 MB] [builder] Get:5 http://ports.ubuntu.com/ubuntu-ports jammy/multiverse arm64 Packages [224 kB] [builder] Get:6 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages [1758 kB] [builder] Get:7 http://ports.ubuntu.com/ubuntu-ports jammy-updates/multiverse arm64 Packages [46.0 kB] [builder] Get:8 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 Packages [1633 kB] [builder] Get:9 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages [3724 kB] [builder] Get:10 http://ports.ubuntu.com/ubuntu-ports jammy-security/universe arm64 Packages [1330 kB] [builder] Get:11 http://ports.ubuntu.com/ubuntu-ports jammy-security/main arm64 Packages [3407 kB] [builder] Get:12 http://ports.ubuntu.com/ubuntu-ports jammy-security/multiverse arm64 Packages [40.2 kB] [builder] Fetched 29.9 MB in 2s (12.2 MB/s) [builder] Reading package lists... [builder] -----> Fetching .debs for mysql-client [builder] Reading package lists... [builder] Building dependency tree... [builder] The following additional packages will be installed: [builder] libbsd0 libedit2 libmd0 mysql-client-8.0 mysql-client-core-8.0 mysql-common [builder] The following NEW packages will be installed: [builder] libbsd0 libedit2 libmd0 mysql-client mysql-client-8.0 mysql-client-core-8.0 [builder] mysql-common [builder] 0 upgraded, 7 newly installed, 0 to remove and 6 not upgraded. [builder] Need to get 3209 kB of archives. [builder] After this operation, 62.1 MB of additional disk space will be used. [builder] Get:1 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libmd0 arm64 1.0.4-1build1 [23.8 kB] [builder] Get:2 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libbsd0 arm64 0.11.5-1 [43.7 kB] [builder] Get:3 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libedit2 arm64 3.1-20210910-1build1 [96.0 kB] [builder] Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 mysql-client-core-8.0 arm64 8.0.44-0ubuntu0.22.04.2 [3006 kB] [builder] Get:5 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 mysql-common all 5.8+1.0.8 [7212 B] [builder] Get:6 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 mysql-client-8.0 arm64 8.0.44-0ubuntu0.22.04.2 [22.6 kB] [builder] Get:7 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 mysql-client all 8.0.44-0ubuntu0.22.04.2 [9354 B] [builder] Fetched 3209 kB in 0s (7823 kB/s) [builder] Download complete and in download only mode [builder] -----> Installing apt packages with dpkg [builder] libbsd0_0.11.5-1_arm64.deb [builder] libedit2_3.1-20210910-1build1_arm64.deb [builder] libmd0_1.0.4-1build1_arm64.deb [builder] mysql-client-8.0_8.0.44-0ubuntu0.22.04.2_arm64.deb [builder] mysql-client-core-8.0_8.0.44-0ubuntu0.22.04.2_arm64.deb [builder] mysql-client_8.0.44-0ubuntu0.22.04.2_all.deb [builder] mysql-common_5.8+1.0.8_all.deb [builder] -----> Writing environment variables [builder] PATH=/layers/paketo-buildpacks_apt/apt/usr/bin ``` -------------------------------- ### Maven Buildpack Binding Structure (Settings XML) Source: https://paketo.io/docs/howto/configuration Example directory structure for a Maven buildpack binding containing a settings.xml file. ```bash /platform └── bindings └── ├── settings.xml └── type ``` -------------------------------- ### Pack Build Output Log Source: https://paketo.io/docs/howto/create-paketo-buildpack Example output from running 'pack build', showing detection, analysis, restoring, and building phases, including the extracted URI. ```text ===> DETECTING [detector] ======== Results ======== [detector] pass: com.example.node-engine@0.0.1 [detector] Resolving plan... (try #1) [detector] com.example.node-engine 0.0.1 ===> ANALYZING [analyzer] Previous image with name "index.docker.io/library/test-node:latest" not found ===> RESTORING ===> BUILDING [builder] URI -> https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz [builder] ERROR: failed to build: exit status 1 [builder] always fail ERROR: failed with status code: 7 ``` -------------------------------- ### Configure Paketo .NET Core Buildpack with Tilt Source: https://paketo.io/docs/howto/dotnet-core Integrate the Paketo .NET Core buildpack with Tilt for live updates. This example configures watched files, syncs source code, and runs build artifacts within the container. It requires the app's source code to be in a subdirectory like './src'. ```python pack( 'myapp', env_vars=[ 'BP_DOTNET_PROJECT_PATH="./src"', 'BP_LIVE_RELOAD_ENABLED=true' ], live_update=[ sync('./build', '/workspace/build'), sync('./src', '/workspace/src'), run('cp -rf /workspace/build/* /workspace/', trigger='./build') ] ) # (Re)build locally when source code changes local_resource( 'dotnet-publish', cmd='rm -rf ./build && dotnet publish src --configuration Release --runtime ubuntu.18.04-x64 --self-contained false --output ./build', deps=['src'], ignore=[ 'src/obj', 'src/bin' ] ) ``` -------------------------------- ### Build Sample Ruby App with Paketo Source: https://paketo.io/docs/howto/ruby Use the pack CLI with the Paketo Ruby Buildpack and a specified builder to build a sample Ruby application into a runnable OCI image. Ensure you have Docker and pack CLI installed. ```bash pack build my-app --buildpack paketo-buildpacks/ruby \ --builder paketobuildpacks/builder-jammy-base ``` -------------------------------- ### Make a Request to the Demo App Source: https://paketo.io/docs Uses curl to send a GET request to the running demo application on localhost:8080. ```bash curl http://localhost:8080/ ``` -------------------------------- ### Build Java App from Executable JAR Source: https://paketo.io/docs/howto/java This example demonstrates building a Java application image from an executable JAR file using `pack`. It first compiles the JAR using Maven and then uses `pack build` to create the image. ```bash cd java/maven ./mvnw package pack build samples/java \ --path /target/demo-0.0.1-SNAPSHOT.jar ``` -------------------------------- ### Enable Live Reloading in Tiltfile Source: https://paketo.io/docs/howto/nodejs Use the Paketo Node.js buildpack with Tilt by configuring the 'pack' resource in your Tiltfile. This example enables live reloading and sets up file synchronization. ```bash pack('my-app', buildpacks=["paketo-buildpacks/nodejs"], env_vars=["BP_LIVE_RELOAD_ENABLED=true"], live_update=[ sync('.', '/workspace'), ] ) ``` -------------------------------- ### Pack Build Output Source: https://paketo.io/docs This is an example of the output generated by the 'pack build' command. It details the detection, analysis, building, and exporting phases, including the versions of buildpacks used and configuration steps. ```text ===> DETECTING 7 of 9 buildpacks participating paketo-buildpacks/ca-certificates 2.4.0 paketo-buildpacks/cpython 0.7.2 paketo-buildpacks/pip 0.5.1 paketo-buildpacks/pipenv 0.2.1 paketo-buildpacks/pipenv-install 0.2.3 paketo-buildpacks/python-start 0.6.2 paketo-buildpacks/procfile 4.3.0 ===> ANALYZING Previous image with name "paketo-demo-app" not found ===> RESTORING ===> BUILDING Paketo CA Certificates Buildpack 2.4.0 https://github.com/paketo-buildpacks/ca-certificates Launch Helper: Contributing to layer Creating /layers/paketo-buildpacks_ca-certificates/helper/exec.d/ca-certificates-helper Paketo CPython Buildpack 0.7.2 Resolving CPython version Candidate version sources (in priority order): -> "" -> "" Selected CPython version (using ): 3.8.12 Executing build process Installing CPython 3.8.12 Completed in 2.884s Configuring environment PYTHONPATH -> "/layers/paketo-buildpacks_cpython/cpython" Paketo Pip Buildpack 0.5.1 Resolving Pip version Candidate version sources (in priority order): -> "" Selected Pip version (using ): 21.2.4 Executing build process Installing Pip 21.2.4 Completed in 7.743s Configuring environment PYTHONPATH -> "/layers/paketo-buildpacks_pip/pip/lib/python3.8/site-packages:$PYTHONPATH" Paketo Pipenv Buildpack 0.2.1 Resolving Pipenv version Candidate version sources (in priority order): -> "" Selected Pipenv version (using ): 2021.5.29 Executing build process Installing Pipenv 2021.5.29 Completed in 5.895s Configuring environment PYTHONPATH -> "/layers/paketo-buildpacks_pipenv/pipenv/lib/python3.8/site-packages:$PYTHONPATH" Paketo Pipenv Install Buildpack 0.2.3 Executing build process Running 'pipenv install --deploy' Running 'pipenv clean' Configuring environment PATH -> "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd/bin:$PATH" PYTHONUSERBASE -> "/layers/paketo-buildpacks_pipenv-install/packages/workspace-dqq3IVyd" Completed in 5.511s Paketo Python Start Buildpack 0.6.2 Assigning launch process web: python Paketo Procfile Buildpack 4.3.0 https://github.com/paketo-buildpacks/procfile Process types: web: gunicorn server:app ===> EXPORTING Adding layer 'paketo-buildpacks/ca-certificates:helper' Adding layer 'paketo-buildpacks/cpython:cpython' Adding layer 'paketo-buildpacks/pipenv-install:packages' Adding 1/1 app layer(s) Adding layer 'launcher' Adding layer 'config' Adding layer 'process-types' Adding label 'io.buildpacks.lifecycle.metadata' Adding label 'io.buildpacks.build.metadata' Adding label 'io.buildpacks.project.metadata' Setting default process type 'web' Saving paketo-demo-app... *** Images (2aa4026c4df4): paketo-demo-app Adding cache layer 'paketo-buildpacks/cpython:cpython' Adding cache layer 'paketo-buildpacks/pip:pip' Adding cache layer 'paketo-buildpacks/pipenv:pipenv' Adding cache layer 'paketo-buildpacks/pipenv-install:cache' Adding cache layer 'paketo-buildpacks/pipenv-install:packages' Successfully built image 'paketo-demo-app' ``` -------------------------------- ### Run Paketo Demo App with Docker Source: https://paketo.io/docs Starts the Paketo demo app image in detached mode, mapping host port 8080 to the container's port 8080 and setting the PORT environment variable. ```bash docker run -d -p 8080:8080 -e PORT=8080 paketo-demo-app ``` -------------------------------- ### Map Dependency to Internal URI Source: https://paketo.io/docs/howto/configuration This example shows how to map a dependency's SHA256 hash to an internal URI, allowing builds to use locally hosted dependencies when external access is restricted. ```shell # Example values: # sha256: b4cb31162ff6d7926dd09e21551fa745fa3ae1758c25148b48dadcf78ab0c24c # uri: https://github.com/bell-sw/Liberica/releases/download/11.0.8+10/bellsoft-jre11.0.8+10-linux-amd64.tar.gz # To configure a build with this mapping, you would typically use a binding: # pack build my-app --binding dependency-mapping=b4cb31162ff6d7926dd09e21551fa745fa3ae1758c25148b48dadcf78ab0c24c=http://internal.example.com/path/to/bellsoft-jre11.0.8+10-linux-amd64.tar.gz ``` -------------------------------- ### Build a Sample .NET Core App Source: https://paketo.io/docs/howto/dotnet-core Build a sample ASP.NET Core application locally using the `pack` CLI with the Paketo .NET Core Buildpack and a specified builder. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples/dotnet-core/aspnet pack build my-app --buildpack paketo-buildpacks/dotnet-core \ --builder paketobuildpacks/builder-jammy-base ``` -------------------------------- ### Build a Sample NGINX App Source: https://paketo.io/docs/howto/web-servers Build a sample NGINX application locally using the `pack` CLI and the Paketo NGINX Buildpack. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples/nginx pack build my-app --buildpack paketo-buildpacks/nginx \ --builder paketobuildpacks/builder-jammy-base ``` -------------------------------- ### Append Arguments to Java App Start Command Source: https://paketo.io/docs/howto/java Pass additional arguments to your Java application's start command by setting the container CMD. This example sets the server port. ```shell docker run --rm --publish 8081:8081 samples/java --server.port=8081 curl -s http://localhost:8081/actuator/health ``` -------------------------------- ### Set up Service Binding for Private Modules Source: https://paketo.io/docs/howto/go Create a directory structure and type file for a service binding to provide credentials for private Go modules. ```bash mkdir /tmp/git-binding echo "git-credentials" > /tmp/git-binding/type touch /tmp/git-binding/credentials ``` -------------------------------- ### Node.js Module Language Module Entry Example Source: https://paketo.io/docs/concepts/sbom This JSON object represents a language module entry for a Node.js module installed via a dependency manager. It includes metadata such as version, licenses, and package URL (pURL). ```json { "name": "httpdispatcher", "metadata": { "licenses": [ "MIT" ], "purl": "pkg:npm/httpdispatcher@2.1.2", "version": "2.1.2" }, "buildpack": { "id": "paketo-buildpacks/node-module-bom", "version": "1.2.3" } } ``` -------------------------------- ### Build Sample Go App with Paketo Source: https://paketo.io/docs/howto/go Use the pack CLI with the Paketo Go Buildpack to build a sample Go application into a runnable OCI image. ```bash pack build my-app --buildpack paketo-buildpacks/go \ --builder paketobuildpacks/builder-jammy-base ``` -------------------------------- ### Main detect binary entrypoint Source: https://paketo.io/docs/howto/create-paketo-buildpack This Go program serves as the entrypoint for the buildpack's detect phase, calling the specific detection logic. ```go package main import ( "" "github.com/paketo-buildpacks/packit" ) func main() { packit.Detect(node.Detect()) } ``` -------------------------------- ### Node.js Runtime Buildpack Entry Example Source: https://paketo.io/docs/concepts/sbom This JSON object represents a buildpack entry for the Node.js runtime installed directly by the Paketo Node Engine buildpack. It includes metadata such as version, CPE, licenses, checksums, and source information. ```json { "name": "Node Engine", "metadata": { "checksum": { "algorithm": "SHA-256", "hash": "a50ee095f936b51fffe5c032a7377a156723145c1ab0291ccc882f04719f1b54" }, "cpe": "cpe:2.3:a:nodejs:node.js:16.7.0:*:*:*:*:*:*:*", "deprecation-date": "2024-04-30T00:00:00Z", "licenses": [ "0BSD", "Apache-2.0", "Artistic-2.0", "BSD-2-Clause", "BSD-3-Clause", "BSD-3-Clause-Clear", "CC0-1.0", "MIT", "MIT-0", "Unicode-TOU" ], "purl": "pkg:generic/node@v16.7.0?checksum=0c4a82acc5ae67744d56f2c97db54b859f2b3ef8e78deacfb8aed0ed4c7cb690&download_url=https://nodejs.org/dist/v16.7.0/node-v16.7.0.tar.gz", "source": { "checksum": { "algorithm": "SHA-256", "hash": "0c4a82acc5ae67744d56f2c97db54b859f2b3ef8e78deacfb8aed0ed4c7cb690" }, "uri": "https://nodejs.org/dist/v16.7.0/node-v16.7.0.tar.gz" }, "stacks": [ "io.buildpacks.stacks.bionic" ], "uri": "https://deps.paketo.io/node/node_v16.7.0_linux_x64_bionic_a50ee095.tgz", "version": "16.7.0" }, "buildpacks": { "id": "paketo-buildpacks/node-engine", "version": "1.2.3" } } ``` -------------------------------- ### Set Global Composer Install Options Source: https://paketo.io/docs/howto/php Configure global 'composer install' settings by setting the BP_COMPOSER_INSTALL_GLOBAL environment variable. This is useful for defining globally installed tools or packages. ```bash pack build my-app --buildpack paketo-buildpacks/php \ --env BP_COMPOSER_INSTALL_GLOBAL="friendsofphp/php-cs-fixer squizlabs/php_codesniffer=*" ``` -------------------------------- ### Build a Sample PHP App Source: https://paketo.io/docs/howto/php Builds a sample PHP application locally using the `pack` CLI and the Paketo PHP Buildpack. Requires the Paketo Full builder. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples/php/builtin-server pack build my-app --buildpack paketo-buildpacks/php \ --builder paketobuildpacks/builder-jammy-full ``` -------------------------------- ### Configure Maven Plugin for Yarn Install Source: https://paketo.io/docs/howto/java This Maven plugin configuration allows `yarn install` to be executed during the `generate-sources` phase. Ensure `BP_JAVA_INSTALL_NODE` is set to `true` for Node and Yarn to be installed. ```xml org.codehaus.mojo exec-maven-plugin ${exec-maven.version} exec-yarn-install generate-sources exec yarn install ``` -------------------------------- ### Build Sample HTTPD App Source: https://paketo.io/docs/howto/web-servers Build a sample HTTPD application locally using the Paketo HTTPD buildpack with the 'pack' CLI. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples/httpd pack build my-app --buildpack paketo-buildpacks/httpd \ --builder paketobuildpacks/builder-jammy-full ``` -------------------------------- ### Build a Sample Node.js App Source: https://paketo.io/docs/howto/nodejs Use the pack CLI to build a sample Node.js application with the Paketo Node.js Buildpack. Ensure you have the Paketo Full builder if your app uses common C libraries. ```bash git clone https://github.com/paketo-buildpacks/samples cd samples/nodejs/npm pack build my-app --buildpack paketo-buildpacks/nodejs \ --builder paketobuildpacks/builder-jammy-base ``` -------------------------------- ### NPM Installation Process Table Source: https://paketo.io/docs/reference/nodejs-reference The Node.js buildpack uses this logic to determine the NPM installation command based on the presence of package-lock.json, node_modules, and npm-cache. ```markdown `package-lock.json` | `node_modules` | `npm-cache` | Command ---|---|---|--- X | X | X | `npm install` X | X | ✓ | `npm install` X | ✓ | X | `npm rebuild` X | ✓ | ✓ | `npm rebuild` ✓ | X | X | `npm ci` ✓ | X | ✓ | `npm ci` ✓ | ✓ | X | `npm rebuild` ✓ | ✓ | ✓ | `npm ci` ``` -------------------------------- ### Clone Paketo Samples and Navigate Source: https://paketo.io/docs Clone the Paketo samples repository and navigate to the source code for the sample ASP.NET app. ```bash git clone https://github.com/paketo-buildpacks/samples \ && cd samples/dotnet-core/aspnet ``` -------------------------------- ### Clone Node.js Sample App and Navigate Source: https://paketo.io/docs Clones the Paketo samples repository and changes the directory to the Node.js npm sample application. ```bash git clone https://github.com/paketo-buildpacks/samples \ && cd samples/nodejs/npm ```