Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
run: |
curl -s -L -o pack.tgz ${{ steps.pack-download-url.outputs.result }}
tar -xvf pack.tgz
- name: Set config needed for image extensions
run: |
./pack config experimental true
./pack config pull-policy always
- name: Build
run: PACK_CMD=./pack make build-linux build-wine
- uses: azure/docker-login@v1
Expand Down
62 changes: 31 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PACK_FLAGS?=--pull-policy=never
PULL_POLICY_NEVER?=--pull-policy=never
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to confess, I'm not sure why this is needed.

PACK_BUILD_FLAGS?=--trust-builder
PACK_CMD?=pack

Expand Down Expand Up @@ -28,55 +28,55 @@ build-linux-builders: build-builder-alpine build-builder-bionic

build-builder-alpine: build-linux-packages build-sample-root
@echo "> Building 'alpine' builder..."
$(PACK_CMD) builder create cnbs/sample-builder:alpine --config $(SAMPLES_ROOT)/builders/alpine/builder.toml $(PACK_FLAGS)
$(PACK_CMD) builder create cnbs/sample-builder:alpine --config $(SAMPLES_ROOT)/builders/alpine/builder.toml $(PULL_POLICY_NEVER)

build-builder-bionic: build-linux-packages build-sample-root
@echo "> Building 'bionic' builder..."
$(PACK_CMD) builder create cnbs/sample-builder:bionic --config $(SAMPLES_ROOT)/builders/bionic/builder.toml $(PACK_FLAGS)
$(PACK_CMD) builder create cnbs/sample-builder:bionic --config $(SAMPLES_ROOT)/builders/bionic/builder.toml $(PULL_POLICY_NEVER)

build-linux-buildpacks: build-buildpacks-alpine build-buildpacks-bionic

build-buildpacks-alpine: build-sample-root
@echo "> Creating 'hello-moon' app using 'alpine' builder..."
$(PACK_CMD) build sample-hello-moon-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-moon-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon $(PACK_BUILD_FLAGS)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only changed the pull policy for alpine, as that's the only builder with extensions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK it stops pack trying to look for cnbs/sample-builder on a registry.


@echo "> Creating 'hello-processes' app using 'alpine' builder..."
$(PACK_CMD) build sample-hello-processes-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-processes $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-processes-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-processes $(PACK_BUILD_FLAGS)

@echo "> Creating 'hello-world' app using 'alpine' builder..."
$(PACK_CMD) build sample-hello-world-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-world-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world $(PACK_BUILD_FLAGS)

@echo "> Creating 'java-maven' app using 'alpine' builder..."
$(PACK_CMD) build sample-java-maven-app:alpine -v --builder cnbs/sample-builder:alpine --path apps/java-maven $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-java-maven-app:alpine -v --builder cnbs/sample-builder:alpine --path apps/java-maven $(PACK_BUILD_FLAGS)

@echo "> Creating 'kotlin-gradle' app using 'alpine' builder..."
$(PACK_CMD) build sample-kotlin-gradle-app:alpine -v --builder cnbs/sample-builder:alpine --path apps/kotlin-gradle $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-kotlin-gradle-app:alpine -v --builder cnbs/sample-builder:alpine --path apps/kotlin-gradle $(PACK_BUILD_FLAGS)

build-buildpacks-bionic: build-sample-root
@echo "> Creating 'hello-moon' app using 'bionic' builder..."
$(PACK_CMD) build sample-hello-moon-app:bionic -v --builder cnbs/sample-builder:bionic --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-moon-app:bionic -v --builder cnbs/sample-builder:bionic --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

@echo "> Creating 'hello-processes' app using 'bionic' builder..."
$(PACK_CMD) build sample-hello-processes-app:bionic -v --builder cnbs/sample-builder:bionic --buildpack $(SAMPLES_ROOT)/buildpacks/hello-processes $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-processes-app:bionic -v --builder cnbs/sample-builder:bionic --buildpack $(SAMPLES_ROOT)/buildpacks/hello-processes $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

@echo "> Creating 'hello-world' app using 'bionic' builder..."
$(PACK_CMD) build sample-hello-world-app:bionic -v --builder cnbs/sample-builder:bionic --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-world-app:bionic -v --builder cnbs/sample-builder:bionic --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

@echo "> Creating 'java-maven' app using 'bionic' builder..."
$(PACK_CMD) build sample-java-maven-app:bionic -v --builder cnbs/sample-builder:bionic --path apps/java-maven $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-java-maven-app:bionic -v --builder cnbs/sample-builder:bionic --path apps/java-maven $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

@echo "> Creating 'kotlin-gradle' app using 'bionic' builder..."
$(PACK_CMD) build sample-kotlin-gradle-app:bionic -v --builder cnbs/sample-builder:bionic --path apps/kotlin-gradle $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-kotlin-gradle-app:bionic -v --builder cnbs/sample-builder:bionic --path apps/kotlin-gradle $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

@echo "> Creating 'ruby-bundler' app using 'bionic' builder..."
$(PACK_CMD) build sample-ruby-bundler-app:bionic -v --builder cnbs/sample-builder:bionic --path apps/ruby-bundler $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-ruby-bundler-app:bionic -v --builder cnbs/sample-builder:bionic --path apps/ruby-bundler $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

build-linux-packages: build-sample-root
@echo "> Creating 'hello-world' buildpack package"
$(PACK_CMD) buildpack package cnbs/sample-package:hello-world --config $(SAMPLES_ROOT)/packages/hello-world/package.toml $(PACK_FLAGS)
$(PACK_CMD) buildpack package cnbs/sample-package:hello-world --config $(SAMPLES_ROOT)/packages/hello-world/package.toml $(PULL_POLICY_NEVER)

@echo "> Creating 'hello-universe' buildpack package"
$(PACK_CMD) buildpack package cnbs/sample-package:hello-universe --config $(SAMPLES_ROOT)/packages/hello-universe/package.toml $(PACK_FLAGS)
$(PACK_CMD) buildpack package cnbs/sample-package:hello-universe --config $(SAMPLES_ROOT)/packages/hello-universe/package.toml $(PULL_POLICY_NEVER)

deploy-linux: deploy-linux-stacks deploy-linux-packages deploy-linux-builders

Expand Down Expand Up @@ -156,18 +156,18 @@ build-stack-wine:

build-builder-wine: build-sample-root
@echo "> Building 'wine' builder..."
$(PACK_CMD) create-builder cnbs/sample-builder:wine --config $(SAMPLES_ROOT)/builders/wine/builder.toml $(PACK_FLAGS)
$(PACK_CMD) create-builder cnbs/sample-builder:wine --config $(SAMPLES_ROOT)/builders/wine/builder.toml $(PULL_POLICY_NEVER)

build-wine-apps: build-sample-root
@echo "> Creating 'batch-script' app using 'wine' builder..."
$(PACK_CMD) build sample-batch-script-app:wine -v --builder cnbs/sample-builder:wine --path apps/batch-script $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-batch-script-app:wine -v --builder cnbs/sample-builder:wine --path apps/batch-script $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

build-buildpacks-wine: build-sample-root
@echo "> Creating 'hello-moon-windows' app using 'wine' builder..."
$(PACK_CMD) build sample-hello-moon-windows-app:wine -v --builder cnbs/sample-builder:wine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon-windows $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-moon-windows-app:wine -v --builder cnbs/sample-builder:wine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon-windows $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

@echo "> Creating 'hello-world-windows' app using 'wine' builder..."
$(PACK_CMD) build sample-hello-world-windows-app:wine -v --builder cnbs/sample-builder:wine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-world-windows-app:wine -v --builder cnbs/sample-builder:wine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

deploy-wine: deploy-wine-stacks deploy-wine-builders

Expand Down Expand Up @@ -233,45 +233,45 @@ build-stack-dotnet-framework-2022:

build-builder-nanoserver-1809: build-windows-packages
@echo "> Building 'nanoserver-1809' builder..."
$(PACK_CMD) builder create cnbs/sample-builder:nanoserver-1809 --config $(SAMPLES_ROOT)/builders/nanoserver-1809/builder.toml $(PACK_FLAGS)
$(PACK_CMD) builder create cnbs/sample-builder:nanoserver-1809 --config $(SAMPLES_ROOT)/builders/nanoserver-1809/builder.toml $(PULL_POLICY_NEVER)

build-builder-dotnet-framework-1809: build-windows-packages
@echo "> Building 'dotnet-framework-1809' builder..."
$(PACK_CMD) builder create cnbs/sample-builder:dotnet-framework-1809 --config $(SAMPLES_ROOT)/builders/dotnet-framework-1809/builder.toml $(PACK_FLAGS)
$(PACK_CMD) builder create cnbs/sample-builder:dotnet-framework-1809 --config $(SAMPLES_ROOT)/builders/dotnet-framework-1809/builder.toml $(PULL_POLICY_NEVER)

build-builder-dotnet-framework-2004: build-windows-packages
@echo "> Building 'dotnet-framework-2004' builder..."
$(PACK_CMD) builder create cnbs/sample-builder:dotnet-framework-2004 --config $(SAMPLES_ROOT)/builders/dotnet-framework-2004/builder.toml $(PACK_FLAGS)
$(PACK_CMD) builder create cnbs/sample-builder:dotnet-framework-2004 --config $(SAMPLES_ROOT)/builders/dotnet-framework-2004/builder.toml $(PULL_POLICY_NEVER)

build-builder-dotnet-framework-2022: build-windows-packages
@echo "> Building 'dotnet-framework-2022' builder..."
$(PACK_CMD) builder create cnbs/sample-builder:dotnet-framework-2022 --config $(SAMPLES_ROOT)/builders/dotnet-framework-2022/builder.toml $(PACK_FLAGS)
$(PACK_CMD) builder create cnbs/sample-builder:dotnet-framework-2022 --config $(SAMPLES_ROOT)/builders/dotnet-framework-2022/builder.toml $(PULL_POLICY_NEVER)

build-buildpacks-nanoserver-1809: build-sample-root
@echo "> Creating 'hello-moon-windows' app using 'nanoserver-1809' builder..."
$(PACK_CMD) build sample-hello-moon-windows-app:nanoserver-1809 -v --builder cnbs/sample-builder:nanoserver-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon-windows $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-moon-windows-app:nanoserver-1809 -v --builder cnbs/sample-builder:nanoserver-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon-windows $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

@echo "> Creating 'hello-world-windows' app using 'nanoserver-1809' builder..."
$(PACK_CMD) build sample-hello-world-windows-app:nanoserver-1809 -v --builder cnbs/sample-builder:nanoserver-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-hello-world-windows-app:nanoserver-1809 -v --builder cnbs/sample-builder:nanoserver-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world-windows $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

build-buildpacks-dotnet-framework-1809: build-sample-root
@echo "> Creating 'dotnet-framework' app using 'dotnet-framework-1809' builder..."
$(PACK_CMD) build sample-dotnet-framework-app:dotnet-framework-1809 -v --builder cnbs/sample-builder:dotnet-framework-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/dotnet-framework --path apps/aspnet $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-dotnet-framework-app:dotnet-framework-1809 -v --builder cnbs/sample-builder:dotnet-framework-1809 --buildpack $(SAMPLES_ROOT)/buildpacks/dotnet-framework --path apps/aspnet $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

build-buildpacks-dotnet-framework-2004: build-sample-root
@echo "> Creating 'dotnet-framework' app using 'dotnet-framework-2004' builder..."
$(PACK_CMD) build sample-dotnet-framework-app:dotnet-framework-2004 -v --builder cnbs/sample-builder:dotnet-framework-2004 --buildpack $(SAMPLES_ROOT)/buildpacks/dotnet-framework --path apps/aspnet $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-dotnet-framework-app:dotnet-framework-2004 -v --builder cnbs/sample-builder:dotnet-framework-2004 --buildpack $(SAMPLES_ROOT)/buildpacks/dotnet-framework --path apps/aspnet $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

build-buildpacks-dotnet-framework-2022: build-sample-root
@echo "> Creating 'dotnet-framework' app using 'dotnet-framework-2022' builder..."
$(PACK_CMD) build sample-dotnet-framework-app:dotnet-framework-2022 -v --builder cnbs/sample-builder:dotnet-framework-2022 --buildpack $(SAMPLES_ROOT)/buildpacks/dotnet-framework --path apps/aspnet $(PACK_FLAGS) $(PACK_BUILD_FLAGS)
$(PACK_CMD) build sample-dotnet-framework-app:dotnet-framework-2022 -v --builder cnbs/sample-builder:dotnet-framework-2022 --buildpack $(SAMPLES_ROOT)/buildpacks/dotnet-framework --path apps/aspnet $(PULL_POLICY_NEVER) $(PACK_BUILD_FLAGS)

build-windows-packages: build-sample-root
@echo "> Creating 'hello-world-windows' buildpack package"
$(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/packages/hello-world-windows/package.toml $(PACK_FLAGS)
$(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/packages/hello-world-windows/package.toml $(PULL_POLICY_NEVER)

@echo "> Creating 'hello-universe-windows' buildpack package"
$(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/packages/hello-universe-windows/package.toml $(PACK_FLAGS)
$(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/packages/hello-universe-windows/package.toml $(PULL_POLICY_NEVER)

deploy-windows-packages:
@echo "> Deploying windows packages..."
Expand Down
33 changes: 32 additions & 1 deletion builders/alpine/builder.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,28 @@ uri = "../../buildpacks/kotlin-gradle"
[[buildpacks]]
uri = "docker://cnbs/sample-package:hello-universe"

# Order used for detection
[[buildpacks]]
id = "samples/hello-extensions"
version = "0.0.1"
uri = "../../buildpacks/hello-extensions"

# Extensions to include in builder
[[extensions]]
id = "samples/tree"
version = "0.0.1"
uri = "../../extensions/tree"

[[extensions]]
id = "samples/curl"
version = "0.0.1"
uri = "../../extensions/curl"

# Order used for detection (buildpacks)
[[order]]
[[order.group]]
id = "samples/hello-extensions"
version = "0.0.1"

[[order]]
[[order.group]]
id = "samples/java-maven"
Expand All @@ -28,6 +49,16 @@ version = "0.0.1"
id = "samples/hello-universe"
version = "0.0.1"

# Order used for detection (extensions)
[[order-extensions]]
[[order-extensions.group]]
id = "samples/tree"
version = "0.0.1"

[[order-extensions.group]]
id = "samples/curl"
version = "0.0.1"

# Stack that will be used by the builder
[stack]
id = "io.buildpacks.samples.stacks.alpine"
Expand Down
16 changes: 16 additions & 0 deletions buildpacks/hello-extensions/bin/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -eo pipefail

echo "---> Hello Extensions Buildpack"

tree --version

layers_dir=$1

cat >> "${layers_dir}/launch.toml" <<EOL
[[processes]]
type = "curl"
command = ["curl"]
args = ["--version"]
default = true
EOL
16 changes: 16 additions & 0 deletions buildpacks/hello-extensions/bin/detect
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -eo pipefail

# 1. GET ARGS
plan_path=$2

# 2. DECLARE DEPENDENCIES (OPTIONAL)
cat >> "${plan_path}" <<EOL
# Uncomment first
#[[requires]]
#name = "tree"

# Uncomment second
#[[requires]]
#name = "curl"
EOL
14 changes: 14 additions & 0 deletions buildpacks/hello-extensions/buildpack.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Buildpack API version
api = "0.9"

# Buildpack ID and metadata
[buildpack]
id = "samples/hello-extensions"
version = "0.0.1"
name = "Hello Extensions Buildpack"
homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/hello-extensions"
description = "A simple buildpack that requires curl."

# Stacks that the buildpack will work with
[[stacks]]
id = "*"
12 changes: 12 additions & 0 deletions extensions/curl/bin/detect
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail

# 1. GET ARGS
plan_path=$CNB_BUILD_PLAN_PATH

# 2. DECLARE DEPENDENCIES (OPTIONAL)
cat >> "${plan_path}" <<EOL
# Extension provides this dependency
[[provides]]
name = "curl"
EOL
10 changes: 10 additions & 0 deletions extensions/curl/bin/generate
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eo pipefail

# 1. GET ARGS
output_dir=$CNB_OUTPUT_DIR

# 2. GENERATE run.Dockerfile
cat >> "${output_dir}/run.Dockerfile" <<EOL
FROM run-image-curl
EOL
10 changes: 10 additions & 0 deletions extensions/curl/extension.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Buildpack API version
api = "0.9"

# Extension ID and metadata
[extension]
id = "samples/curl"
version = "0.0.1"
name = "Curl Extension"
homepage = "https://github.com/buildpacks/samples/tree/main/extensions/curl"
description = "A simple extension that switches the runtime base image to `curlimages/curl:latest`"
12 changes: 12 additions & 0 deletions extensions/tree/bin/detect
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail

# 1. GET ARGS
plan_path=$CNB_BUILD_PLAN_PATH

# 2. DECLARE DEPENDENCIES (OPTIONAL)
cat >> "${plan_path}" <<EOL
# Extension provides this dependency
[[provides]]
name = "tree"
EOL
14 changes: 14 additions & 0 deletions extensions/tree/bin/generate
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail

# 1. GET ARGS
output_dir=$CNB_OUTPUT_DIR

# 2. GENERATE build.Dockerfile
cat >> "${output_dir}/build.Dockerfile" <<EOL
ARG base_image
FROM \${base_image}

USER root
RUN apk update update && apk add tree
EOL
10 changes: 10 additions & 0 deletions extensions/tree/extension.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Buildpack API version
api = "0.9"

# Extension ID and metadata
[extension]
id = "samples/tree"
version = "0.0.1"
name = "Tree Extension"
homepage = "https://github.com/buildpacks/samples/tree/main/extensions/tree"
description = "A simple extension that installs tree at build time"
20 changes: 20 additions & 0 deletions stacks/alpine/run/curl.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM curlimages/curl

ARG cnb_uid=1000
ARG cnb_gid=1001

# Create user and group
USER root
RUN addgroup -g ${cnb_gid} cnb && \
adduser -u ${cnb_uid} -G cnb -s /bin/bash -D cnb

# Set user and group (as declared in base image)
USER ${CNB_USER_ID}:${CNB_GROUP_ID}

# Set required CNB information
ENV CNB_USER_ID=${cnb_uid}
ENV CNB_GROUP_ID=${cnb_gid}

# Set required CNB information
LABEL io.buildpacks.stack.id=io.buildpacks.samples.stacks.alpine