Skip to content
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

User provided stacks #33

Closed
ekcasey opened this issue Sep 28, 2018 · 0 comments
Closed

User provided stacks #33

ekcasey opened this issue Sep 28, 2018 · 0 comments
Assignees
Labels
size/lg Large level of effort

Comments

@ekcasey
Copy link
Member

ekcasey commented Sep 28, 2018

As a buildpack developer I want to create a builder image on top of a custom stack so that I can create builder images specific to my platform

Creating a builder with a custom Stack

It respects the -s or --stack flag

Given I have created a ~/.pack/config.toml file with the following contents

[[stacks]]
id = “my.custom.stack”
run-images = ["my-org/run", "registry2.org/my-org/run" ]
build-images = ["my-org/build"]

When I run pack create-builder my-org/builder -s "my.custom-stack" -b builder.toml
Then an image my-org/builder is created using my-org/build as the base image
And The following label is added to the builder image io.buildpacks.stack.id=my.custom.stack

It respects the default stack field

Given I have created a ~/.pack/config.toml file with the following contents

default-stack-id = “my.custom.stack”
[[stacks]]
id = “my.custom.stack”
run-images = ["my-org/run", "registry2.org/my-org/run" ]
build-images = ["my-org/build"]

When I run pack create-builder my-org/builder -b builder.toml
Then an image my-org/builder is created using my-org/build as the base image

Building with a custom stack

Given I have created my-org/builder using my.custom.stack
When I run pack build --builder my-org/builder my-org/app
Then my-org/app image is generated using my-org/run as the base image

It defaults to the run-image with a registry matching the app image

Given I have added new default stack to my config.toml file

[[stacks]]
id = “my.custom.stack”
run-images = ["my-org/run", "registry2.org/my-org/run" ]
build-images = ["my-org/build"]

Given I have created my-org/builder using my.custom.stack
When I run pack build --builder my-org/builder registry2.org/my-org/app
Then an app image registry2.org/my-org/app is generated using registry2.org/my-org/run as the base image

Allows custom run-images but errors on stack mismatch

Given I have created my-org/builder using my.custom.stack
When I run pack build --builder my-org/builder registry2.org/my-org/app --run-image some-org/bad-run-image
Where some-org/bad-run-image no io.buildpacks.stack.id label or a io.buildpacks.stack.id label who's value does not match my.custom.stack
Then it fails and prints a helpful error message

  • run-images with correct stack labels are allowed, even if they are not included in the config.toml file

Recording default stacks

Whenever pack build or pack create-builder is run, any new stacks are added to the config.toml if they do not exist already and bionic is set as the default stack if none is specified.

Note

  • For domain matching look at domain matching in img package
@ekcasey ekcasey added this to Icebox in Planning Board via automation Sep 28, 2018
@ekcasey ekcasey moved this from Icebox to Backlog in Planning Board Sep 28, 2018
@ekcasey ekcasey changed the title pack create-builder with user provided stack User provided stacks Sep 28, 2018
@ssisil ssisil added the size/lg Large level of effort label Oct 1, 2018
@dgodd dgodd moved this from Backlog to In Progress in Planning Board Oct 1, 2018
ekcasey added a commit that referenced this issue Oct 3, 2018
* Stack info is stored in ~/.pack/config.toml
* create-builder takes a --stack flag
* build uses run image for builder's stack

[#33]

Signed-off-by: Dave Goddard <dave@goddard.id.au>
@ekcasey ekcasey moved this from In Progress to Done in Planning Board Oct 3, 2018
@ssisil ssisil moved this from Done to Release 4 in Planning Board Oct 5, 2018
@ssisil ssisil closed this as completed Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/lg Large level of effort
Projects
None yet
Development

No branches or pull requests

3 participants