-
Notifications
You must be signed in to change notification settings - Fork 458
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
Add pack option to the builder options for cloud native buildpacks #916
base: main
Are you sure you want to change the base?
Changes from 1 commit
897b3b4
826308a
d0ffb85
24f4308
ae68193
2c5f2a7
548452a
85a5a09
e252004
7174174
f7147e0
c601241
dda8efe
5482052
89b4415
1d55c59
4822a9d
d538447
145b73c
1ebc8b8
cde5c7a
8354fbe
9ac3d57
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class Kamal::Commands::Builder::Native::Pack < Kamal::Commands::Builder::Native | ||
def push | ||
combine \ | ||
pack(:build, | ||
config.absolute_image, | ||
"--platform", platform, | ||
"--builder", pack_builder, | ||
buildpacks, | ||
"-t", config.absolute_image, | ||
"-t", config.latest_image, | ||
"--env", "BP_IMAGE_LABELS=service=#{config.service}", | ||
secrets.map { |secret| ["--env", Kamal::Utils.sensitive(ENV[secret])] }, | ||
nickhammond marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"--path", build_context), | ||
docker(:push, config.absolute_image), | ||
docker(:push, config.latest_image) | ||
end | ||
|
||
private | ||
def platform | ||
"linux/#{pack_arch}" | ||
end | ||
|
||
def buildpacks | ||
(pack_buildpacks << "paketo-buildpacks/image-labels").map { |buildpack| ["--buildpack", buildpack] } | ||
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. Adding this buildpack automatically so that we can label the image for Kamal |
||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,16 @@ builder: | |
arch: arm64 | ||
host: ssh://docker@docker-builder | ||
|
||
# Buildpack configuration | ||
# | ||
# The build configuration for using pack to build a Cloud Native Buildpack image. | ||
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. Add mention of project.toml to set your excluded options. https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/use-project-toml/ 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. As I was thinking about this and removing |
||
pack: | ||
builder: heroku/builder:24 | ||
arch: amd64 | ||
buildpacks: | ||
- heroku/ruby | ||
- heroku/procfile | ||
|
||
# Builder cache | ||
# | ||
# The type must be either 'gha' or 'registry' | ||
|
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.
Kamal expects there to be a service label, this automatically adds the label via the
paketo-buildpacks/image-labels
buildpack.