### Build Stack Script Example Source: https://github.com/buildpacks/samples/blob/main/base-images/README.md An example command demonstrating how to build a specific stack using the build-stack script. ```bash ./build-stack.sh resolute ``` -------------------------------- ### Build Linux-Based Containers with Make Source: https://github.com/buildpacks/samples/blob/main/README.md Use this command to build Linux-based containers. Ensure Docker, Pack, and Make are installed. ```shell make build-linux ``` -------------------------------- ### Build Windows-Based Containers with Make Source: https://github.com/buildpacks/samples/blob/main/README.md Use this command to build Windows-based containers. Ensure Docker, Pack, and Make are installed, along with WSL w/ Ubuntu on Windows. ```shell make build-windows ``` -------------------------------- ### Create Resolute Builder Source: https://github.com/buildpacks/samples/blob/main/builders/resolute/README.md Use this command to create the resolute builder. Ensure you have Pack installed and a builder.toml configuration file. ```bash pack builder create cnbs/sample-builder:resolute --config builder.toml ``` -------------------------------- ### Build the Hello World App with Resolute Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-world/README.md Use this command to build the sample application using the cnbs/sample-builder:resolute. Ensure the buildpack is in the current directory. ```bash pack build sample-hello-world-app --builder cnbs/sample-builder:resolute --buildpack . ``` -------------------------------- ### Build the Hello World App Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-world/README.md Use this command to build the sample application using the cnbs/sample-builder:alpine. Ensure the buildpack is in the current directory. ```bash pack build sample-hello-world-app --builder cnbs/sample-builder:alpine --buildpack . ``` -------------------------------- ### Build Sample App Image Source: https://github.com/buildpacks/samples/blob/main/apps/README.md Use this command to build a Docker image for a sample application. Replace `` with the specific application directory and choose either 'resolute' or 'alpine' for the builder tag. ```bash pack build -p apps/ --builder cnbs/sample-builder: sample-app ``` -------------------------------- ### Create Sample Alpine Builder Source: https://github.com/buildpacks/samples/blob/main/builders/alpine/README.md Use this command to create the sample Alpine builder. A `builder.toml` configuration file is required. ```bash pack builder create cnbs/sample-builder:alpine --config builder.toml ``` -------------------------------- ### Build Sample App (Resolute Builder) Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-processes/README.md Builds the sample application using the 'cnbs/sample-builder:resolute' builder and the current directory's buildpack. ```bash pack build sample-hello-processes-app --builder cnbs/sample-builder:resolute --buildpack ../java-maven --buildpack . --path ../../apps/java-maven ``` -------------------------------- ### Build App with Sample Alpine Builder Source: https://github.com/buildpacks/samples/blob/main/builders/alpine/README.md Build a sample application using the previously created sample Alpine builder. Specify the application path. ```bash pack build sample-app --builder cnbs/sample-builder:alpine --path ../../apps/java-maven/ ``` -------------------------------- ### Run Built Sample App Source: https://github.com/buildpacks/samples/blob/main/apps/README.md After building the application image, use this command to run the container. It maps port 8080 from the container to the host machine. ```bash docker run -it -p 8080:8080 sample-app ``` -------------------------------- ### Build Hello Universe App with Resolute Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-universe/README.md Use this command to build the Hello Universe application using the cnbs/sample-builder with a Resolute base. It specifies the current buildpack and two other local buildpacks. ```bash pack build sample-hello-universe-app \ --builder cnbs/sample-builder:resolute \ --buildpack . \ --buildpack ../hello-world/ \ --buildpack ../hello-moon/ ``` -------------------------------- ### Build Hello Universe App with Alpine Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-universe/README.md Use this command to build the Hello Universe application using the cnbs/sample-builder with an Alpine base. It specifies the current buildpack and two other local buildpacks. ```bash pack build sample-hello-universe-app \ --builder cnbs/sample-builder:alpine \ --buildpack . \ --buildpack ../hello-world/ \ --buildpack ../hello-moon/ ``` -------------------------------- ### Build Hello Moon App with Alpine Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-moon/README.md Builds the sample-hello-moon-app using the cnbs/sample-builder:alpine builder and specifying both the hello-world and the current buildpack. ```bash pack build sample-hello-moon-app --builder cnbs/sample-builder:alpine --buildpack ../hello-world/ --buildpack . ``` -------------------------------- ### Build Sample App (Alpine Builder) Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-processes/README.md Builds the sample application using the 'cnbs/sample-builder:alpine' builder and the current directory's buildpack. ```bash pack build sample-hello-processes-app --builder cnbs/sample-builder:alpine --buildpack ../java-maven --buildpack . --path ../../apps/java-maven ``` -------------------------------- ### Build Hello Moon App with Resolute Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-moon/README.md Builds the sample-hello-moon-app using the cnbs/sample-builder:resolute builder and specifying both the hello-world and the current buildpack. ```bash pack build sample-hello-moon-app --builder cnbs/sample-builder:resolute --buildpack ../hello-world/ --buildpack . ``` -------------------------------- ### Build Sample Batch Script App Source: https://github.com/buildpacks/samples/blob/main/apps/batch-script/README.md Use this command to build the sample batch script application with a specified builder and trust the builder. ```bash pack build sample-batch-script-app --builder cnbs/sample-builder:nanoserver-2022 --trust-builder ``` -------------------------------- ### Run the Built Application Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-world/README.md After building, run the application container and execute an echo command to verify. ```bash docker run sample-hello-world-app echo hello ``` -------------------------------- ### Build App with Resolute Builder Source: https://github.com/buildpacks/samples/blob/main/builders/resolute/README.md This command builds a sample application using the resolute builder. It specifies the application path and the builder to use. ```bash pack build sample-app --builder cnbs/sample-builder:resolute --path ../../apps/java-maven/ ``` -------------------------------- ### Build Sample Bash Script App with Alpine Builder Source: https://github.com/buildpacks/samples/blob/main/apps/bash-script/README.md Use this command to build the sample bash script application with the `cnbs/sample-builder:alpine` builder. ```bash pack build sample-bash-script-app --builder cnbs/sample-builder:alpine ``` -------------------------------- ### Build Sample Bash Script App with Resolute Builder Source: https://github.com/buildpacks/samples/blob/main/apps/bash-script/README.md Use this command to build the sample bash script application with the `cnbs/sample-builder:resolute` builder. ```bash pack build sample-bash-script-app --builder cnbs/sample-builder:resolute ``` -------------------------------- ### Build Stack Script Usage Source: https://github.com/buildpacks/samples/blob/main/base-images/README.md Displays the usage instructions for the build-stack script, outlining available flags and arguments. ```text Usage: ./stacks/build-stack.sh [-f ] [-p ] -f prefix to use for images (default: cnbs/sample-base) -p prefix to use for images (default: amd64) directory of stack to build ``` -------------------------------- ### Build Ruby Bundler App Source: https://github.com/buildpacks/samples/blob/main/buildpacks/ruby-bundler/README.md Builds a sample Ruby application using the Ruby Bundler buildpack. Ensure you are in the correct project directory. ```bash pack build sample-ruby-bundler-app --builder cnbs/sample-builder:resolute --buildpack . --path ../../apps/ruby-bundler ``` -------------------------------- ### Run Web Server Process Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-processes/README.md Runs the 'web' process type from the built application container, exposing port 8080. ```bash # Web server docker run --env CNB_PROCESS_TYPE=web -it -p 8080:8080 sample-hello-processes-app ``` -------------------------------- ### Build Java Maven App with Resolute Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/java-maven/README.md Use this command to build a Java Maven application using the `cnbs/sample-builder:resolute` builder. ```bash pack build sample-java-maven-app --builder cnbs/sample-builder:resolute --buildpack . --path ../../apps/java-maven ``` -------------------------------- ### Build Java Maven App with Alpine Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/java-maven/README.md Use this command to build a Java Maven application using the `cnbs/sample-builder:alpine` builder. ```bash pack build sample-java-maven-app --builder cnbs/sample-builder:alpine --buildpack . --path ../../apps/java-maven ``` -------------------------------- ### Run Default Web Server Process Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-processes/README.md Runs the default web server process type from the built application container, exposing port 8080. ```bash # Web server (default) docker run -it -p 8080:8080 sample-hello-processes-app ``` -------------------------------- ### Run System Info Process Source: https://github.com/buildpacks/samples/blob/main/buildpacks/hello-processes/README.md Runs the 'sys-info' process type from the built application container to display system information. ```bash # System info docker run --env CNB_PROCESS_TYPE=sys-info -it sample-hello-processes-app ``` -------------------------------- ### Build Kotlin Gradle App with Resolute Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/kotlin-gradle/README.md Use this command to build a Kotlin Gradle application using the 'cnbs/sample-builder:resolute' builder. ```bash pack build sample-kotlin-gradle-app --builder cnbs/sample-builder:resolute --buildpack . --path ../../apps/kotlin-gradle ``` -------------------------------- ### Build Kotlin Gradle App with Alpine Builder Source: https://github.com/buildpacks/samples/blob/main/buildpacks/kotlin-gradle/README.md Use this command to build a Kotlin Gradle application using the 'cnbs/sample-builder:alpine' builder. ```bash pack build sample-kotlin-gradle-app --builder cnbs/sample-builder:alpine --buildpack . --path ../../apps/kotlin-gradle ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.