liveBook · Manning

Cloud Native Buildpacks

As explained in Shipping Go: Develop, deliver, discuss, design, and go again

Cloud Native Buildpacks is a specification and implementation ecosystem for transforming application source code into container images through composable buildpacks.

An application that runs on one developer’s machine may fail elsewhere because a dependency or operating-system difference was missed. Cloud Native Buildpacks help turn source code into a portable container image: provide the code, choose a builder, and let it assemble the image for a container runtime. section 1.3.6 section 7.2

A build has two stages: detection and building. Detection checks whether the source is recognizable; for a Go application, a builder can identify the project from its module file and find a main package to run. The build then creates the container image. Builders can use the libraries, dependencies, and base images suited to a hosting platform, while retaining the portability of a container. section 7.2 section 7.3 section 7.1

Build and check a Go service locally

Install Docker as the container runtime and pack as the Buildpacks tool. Run `pack builder suggest` to inspect available builders, then build the application with the Google builder. Run `docker run hello-api` and call the service’s translation endpoint to check that it works in its container. section 7.3

pack build hello-api --builder gcr.io/buildpacks/builder:v1

This is the concrete pack command for building the example image with a selected builder. section 7.3

The practical payoff is a repeatable path from local development toward hosted deployment. Buildpacks handle image creation; a container runtime runs the resulting image locally or in production. section 7.3 section 7.9

How Shipping Go: Develop, deliver, discuss, design, and go again covers it

How deep it goes
Explains detection and building, then demonstrates a local build and run; stops short of defining a custom container.
Examples
Uses a Go service, `pack builder suggest`, a Google builder, and `docker run` to check a translation endpoint.
What it assumes
Assumes an application project and directs readers to install Docker and pack before building its image.
What you can do after
Apply it via pack to build an application image, then run and check that image with Docker.
How it connects
Links Buildpacks to containers, container runtimes, base images, and platform-as-a-service deployment.

Also explained in

Compare how 2 books explain Cloud Native Buildpacks →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Shipping Go: Develop, deliver, discuss, design, and go again. The section links point to the parts of the book it draws on.