top | item 18131378

CNCF to Host Cloud Native Buildpacks in the Sandbox

81 points| rettori | 7 years ago |cncf.io | reply

48 comments

order
[+] sclevine|7 years ago|reply
For those who would like to better understand the technology:

Presentation to CNCF TOC: https://docs.google.com/presentation/d/1RkygwZw7ILVgGhBpKnFN...

Formal specification: https://github.com/buildpack/spec

Sample buildpacks: https://github.com/buildpack/samples

[+] a012|7 years ago|reply
It's first time I heard of buildpacks, can I just throw in other than nodejs, ie. Laravel source code and build an image?
[+] jacques_chester|7 years ago|reply
If there is a conforming buildpack, then yes.

What you're looking at here is informally the "v3" effort, which extends and consolidates the "v2a" and "v2b" designs evolved by Heroku and Cloud Foundry respectively from the original Heroku design.

In v2 both Heroku and Cloud Foundry provide supported PHP buildpacks, as well as Java, Ruby, Python, .NET Core and I forget the rest right now. There are hundreds of community buildpacks.

[+] dreyfiz|7 years ago|reply
Yeah, do you have a composer.json in the root of your repo? Buildpack will detect a PHP app...
[+] josegonzalez|7 years ago|reply
> As one of the maintainers of Herokuish - a tool that manages the application of buildpacks to repositories and is used in quite a few Buildpack implementations - I am super happy that CNCF reached out to us and included us in the process. Oh wait, that didn't happen...

All jokes aside, this looks great. Super-early of course - seems like there are quite a few issues in the `pack` repository to be implemented - but I'm excited to see where this lands. Buildpack detection and application is not a straightforward problem.

[+] gigatexal|7 years ago|reply
What am I missing? Looking at the example for java it looks a lot more complicated and a step back from docker and its layers concept.
[+] sclevine|7 years ago|reply
Dockerfiles require you to rebuild lower layers when any upper layers change, even though the OCI image format doesn't care about this. Cloud Native Buildpacks can intelligently choose which layers to rebuild and replace. Additionally, certain layers can be updated en mass for many images on a registry (using cross-repo blob mounting, with no real data transfer!), which is useful for patching CVEs quickly at scale.

The samples take advantage of this (as well as a separate transparent cache) in order to demonstrate the different aspects of the formal spec. A simple buildpack is not necessarily much more complicated than a simple Dockerfile.

[+] jacques_chester|7 years ago|reply
There are several audiences.

1. Developers.

What you need to know is: it just works. You don't even need to write a Dockerfile any more. The buildpack turns your code into a well-structured, efficient runnable image with no additional effort.

2. Operators.

What you need to know is: oh thank god no more mystery meat in production. Patching the OS is a ho-hum affair instead of a stone grinding nightmare that turns your developers into a white hot bucket of rage because you have to nag them or block them from deploying or both.

3. Platform vendors, buildpack authors and curious passers-by

What you need to know is: All the other stuff about detect, analyse, build or export.

Unless you are in group 3, the basic thing is that Buildpacks require less effort than Dockerfiles with more safety and faster builds.

[+] coredog64|7 years ago|reply
I don't think you're missing anything. It's vendors that don't do Docker trying to stay relevant in a Docker/Kubernetes world. By making Docker more complex, said vendors can continue to charge $500/pod for OSS k8s.
[+] mosselman|7 years ago|reply
I just tried this on my rails project and it is detecting a nodejs project. Is there a way to have it use ruby instead while still taking care of my yarn dependencies?
[+] justinsaccount|7 years ago|reply
This can be a problem with buildpacks, since you'd need one buildpack that has both the ruby and nodejs runtimes.

With Docker it is easy to make this work using multi-stage builds, I'm not sure if buildpacks account for this at all.

[+] EdSchouten|7 years ago|reply
I currently use Bazel in combination with rules_docker to construct container images of applications, often written in Go. As I don't depend on cgo, my container images may be bare (i.e., only containing a Go executable and some static artifacts).

Though I understand that there are likely only dozens of us, my question is: what would the use of Buildpacks buy us for this specific use case?

[+] justinsaccount|7 years ago|reply
one case is that you could have a bazel buildpack that contains bazel and java and all that stuff requires in order to run the build.

Unfortunately the resulting image would be larger than just a single binary, but building it would be a lot easier and repeatable for other people working on the project. The base layers would be cached though so in practice it might not be that much larger on disk.

I looked into using bazel for doing similar things, and the biggest stumbling block is that bazel itself is a PITA to install on all platforms. May end up trying https://please.build/ at some point.

[+] jacques_chester|7 years ago|reply
Mostly the advantage would be that 1) you wouldn't have to maintain the buildpack yourself, 2) operators can upgrade your software without needing to get you to do it, 3) upgrades might actually be faster due to layer rebasing and 4) if you add other stacks to your architecture, you still have the same development, deployment and update experience.
[+] jacques_chester|7 years ago|reply
Hi, in my role as professional gadfly, I have been involved with this tangentially for a few months and directly for a few weeks (on behalf of Pivotal).

I will make mistakes, but ... AMA.

[+] spenczar5|7 years ago|reply
I know almost nothing about this topic. I have only really built container images with Dockerfiles. How would you introduce buildpacks to me?
[+] CameronNemo|7 years ago|reply
I wonder how this relates to LinuxKit.
[+] codefinger|7 years ago|reply
LinuxKit (as I understand it) is for building the OS itself. Buildpacks are a higher level abstract for building a complete application image (with the emphasis on application). They take app source code as input, and output a docker image that's ready for prod.
[+] tjfontaine|7 years ago|reply
LinuxKit is a way to build immutable machine images by stitching multiple containers together.

You could use the resulting container from a buildpack in an image built by LinuxKit.

[+] m-arnold|7 years ago|reply
What is the difference between buildpacks and packer?