-
Notifications
You must be signed in to change notification settings - Fork 155
Add fixtures for testing phases 1 and 2 of Dockerfiles #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f208b9c
1069561
e623a93
924fafb
f2091f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| PACK_BUILD_FLAGS?=--trust-builder | ||
| PACK_CMD?=pack | ||
|
|
||
|
|
@@ -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) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK it stops |
||
|
|
||
| @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 | ||
|
|
||
|
|
@@ -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 | ||
|
|
||
|
|
@@ -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..." | ||
|
|
||
| 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 |
| 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 |
| 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 = "*" |
| 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 |
| 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 |
| 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`" |
| 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 |
| 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 |
| 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" |
| 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 | ||
|
|
There was a problem hiding this comment.
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.