Skip to content

Commit

Permalink
Use latest samples image (#779)
Browse files Browse the repository at this point in the history
Bump all examples to use the latest samples based on the latest Ubuntu
LTS.

Signed-off-by: Aidan Delaney <[email protected]>
  • Loading branch information
AidanDelaney authored Nov 6, 2024
1 parent b172432 commit 183a23f
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion content/docs/app-journey.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ cd samples/apps/java-maven

3. Build the app using [`pack`][pack-docs]
```
pack build myapp --builder cnbs/sample-builder:jammy
pack build myapp --builder cnbs/sample-builder:noble
```
<!--+- "{{execute}}"+-->

Expand Down
2 changes: 1 addition & 1 deletion content/docs/for-app-developers/concepts/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ a [build-time base image], a [lifecycle] binary, and a reference to a [runtime b
<!--more-->

The [build-time base image] provides the base environment for the `builder`
(e.g., an Ubuntu Jammy OS image with build tooling) and
(e.g., an Ubuntu Noble OS image with build tooling) and
a [runtime base image] provides the base environment for the `app image` during runtime.

![builder](/images/builder.svg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export FOO=BAR
pack build sample-app \
--env "HELLO=WORLD" \
--env "FOO" \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--buildpack samples/buildpacks/hello-world/ \
--buildpack samples/apps/bash-script/bash-script-buildpack/ \
--path samples/apps/bash-script/
Expand Down Expand Up @@ -79,7 +79,7 @@ echo -en "HELLO=WORLD\nFOO" > ./envfile
```
pack build sample-app \
--env-file ./envfile \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--buildpack samples/buildpacks/hello-world/ \
--buildpack samples/apps/bash-script/bash-script-buildpack/ \
--path samples/apps/bash-script/
Expand Down Expand Up @@ -125,7 +125,7 @@ EOL
2. Build the app
```
pack build sample-app \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--buildpack samples/buildpacks/hello-world/ \
--buildpack samples/apps/bash-script/bash-script-buildpack/ \
--path samples/apps/bash-script/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ For the following examples we will use:
> **NOTE:** If we wish to publish to an external registry like `Dockerhub` we will first need to authenticate with `docker` to allow us to push images. We can do this via `docker login`

Next we trust the `cnbs/sample-builder:jammy` builder in order to allow access to docker credentials when publishing.
Next we trust the `cnbs/sample-builder:noble` builder in order to allow access to docker credentials when publishing.

```
pack config trusted-builders add cnbs/sample-builder:jammy
pack config trusted-builders add cnbs/sample-builder:noble
```
<!--+- "{{execute}}"+-->

Expand All @@ -42,7 +42,7 @@ To build the `localhost:5000/buildpack-examples/cache-image-example` application

```
pack build localhost:5000/buildpack-examples/cache-image-example \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--buildpack samples/java-maven \
--path samples/apps/java-maven \
--cache-image localhost:5000/buildpack-examples/maven-cache-image:latest \
Expand Down Expand Up @@ -76,7 +76,7 @@ builds may also update the specified `cache-image`.
The following command will restore data for the `samples/java-maven:maven_m2` layer from the cache image.
```
pack build localhost:5000/buildpack-examples/second-cache-image-example \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--buildpack samples/java-maven \
--path samples/apps/java-maven \
--cache-image localhost:5000/buildpack-examples/maven-cache-image:latest \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To use a `project.toml` file, simply:
```shell script
# build the app
pack build sample-app \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--path samples/apps/bash-script/

# run the app
Expand All @@ -55,7 +55,7 @@ docker run sample-app
If the descriptor is named `project.toml`, it will be read by `pack` automatically. Otherwise, you can run:
```shell script
pack build sample-app \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--path samples/apps/bash-script/ \
--descriptor samples/apps/bash-script/<project-descriptor-file.toml>
```
Expand Down Expand Up @@ -99,7 +99,7 @@ Paste the above `toml` as `new-project.toml` in the `samples/apps/bash-script/`
```shell script
# build the app
pack build sample-app \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--path samples/apps/bash-script/ \
--descriptor samples/apps/bash-script/new-project.toml

Expand All @@ -112,7 +112,7 @@ The builder can also be [specified](https://github.com/buildpacks/spec/blob/main

```toml
[io.buildpacks]
builder = "cnbs/sample-builder:jammy"
builder = "cnbs/sample-builder:noble"
```

```shell script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Now, we can mount this volume during `pack build`:
```bash
ls -al
pack build volume-example \
--builder cnbs/sample-builder:jammy \
--builder cnbs/sample-builder:noble \
--buildpack samples/buildpacks/hello-world \
--path samples/apps/bash-script \
--volume test-volume:/platform/volume:ro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You should see the following:

```text
Run Images:
cnbs/sample-base-run:jammy
cnbs/sample-base-run:noble
...
Buildpacks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ git clone https://github.com/buildpacks/samples
![](https://i.imgur.com/0mmV6K7.png)

```shell=bash
pack build sample-app -p samples/apps/ruby-bundler/ -B cnbs/sample-builder:jammy
pack build sample-app -p samples/apps/ruby-bundler/ -B cnbs/sample-builder:noble
```

Where:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The OCI layout feature must be enabled using the convention `oci:<path/to/save/i
For example:

```bash
pack build oci:sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:bionic
pack build oci:sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:noble
```

It will save the image in a folder `./sample-app` created in your current directory.
Expand Down Expand Up @@ -101,7 +101,7 @@ If you don't need your `run-image` layers on disk, you can skip them using `--sp
For example:

```bash
pack build oci:sample-app --sparse --path samples/apps/java-maven --builder cnbs/sample-builder:bionic
pack build oci:sample-app --sparse --path samples/apps/java-maven --builder cnbs/sample-builder:noble
```

Verify your application image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ We show how to solve both of these constraints.
You may need the `pack` command-line tool to download buildpacks and images via your proxy. Building an application with an incorrectly configured proxy results in errors such as the following:

```console
$ pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:jammy
ERROR: failed to build: failed to fetch builder image 'index.docker.io/cnbs/sample-builder:jammy'
$ pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:noble
ERROR: failed to build: failed to fetch builder image 'index.docker.io/cnbs/sample-builder:noble'
: Error response from daemon: Get "https//registry-1.docker.io/v2/": context deadline exceeded
```

Expand All @@ -41,7 +41,7 @@ Buildpacks may also need to be aware of your http and https proxies at build tim
```console
export http_proxy=http://user:[email protected]:3128
export https_proxy=https://my-proxy.example.com:3129
pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:jammy
pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:noble
```

## Making your Application Proxy Aware
Expand Down
6 changes: 3 additions & 3 deletions content/docs/for-app-developers/tutorials/basic-app/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pack builder suggest
```
<!--+- "{{execute}}"+-->

For this guide we're actually going to use a sample builder, `cnbs/sample-builder:jammy`, which is not listed
For this guide we're actually going to use a sample builder, `cnbs/sample-builder:noble`, which is not listed
as a suggested builder for good reason. It's a sample.

### 2. Build your app
Expand All @@ -41,12 +41,12 @@ ls samples || git clone https://github.com/buildpacks/samples

2. Build the app
```
pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:jammy
pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:noble
```
<!--+- "{{execute}}"+-->

> **TIP:** If you don't want to keep specifying a builder every time you build, you can set it as your default
> builder by running `pack config default-builder <BUILDER>` for example `pack config default-builder cnbs/sample-builder:jammy`
> builder by running `pack config default-builder <BUILDER>` for example `pack config default-builder cnbs/sample-builder:noble`
<!--+- "{{execute}}"+-->
### 3. Run it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ os = "linux"

# Stacks (deprecated) the buildpack will work with
[[stacks]]
id = "io.buildpacks.stacks.jammy"
id = "io.buildpacks.stacks.noble"
```

For more information, see [buildpack config](/docs/reference/config/buildpack-config).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Before we get started, make sure you've got the following installed:
<!--
```bash
docker rmi test-node-js-app
pack config trusted-builders add cnbs/sample-builder:jammy
pack config trusted-builders add cnbs/sample-builder:noble
```
-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pack buildpack new examples/node-js \
--api 0.10 \
--path node-js-buildpack \
--version 0.0.1 \
--stacks io.buildpacks.samples.stacks.jammy
--stacks io.buildpacks.samples.stacks.noble
```
<!--+- "{{execute}}"+-->
This command will create `node-js-buildpack` directory which contains `buildpack.toml`, `bin/build`, `bin/detect` files.
Expand Down Expand Up @@ -58,13 +58,13 @@ os = "linux"

# Stacks (deprecated) the buildpack will work with
[[stacks]]
id = "io.buildpacks.samples.stacks.jammy"
id = "io.buildpacks.samples.stacks.noble"

```

The buildpack ID is the way you will reference the buildpack when you create buildpack groups, builders, etc.
[Targets](/docs/for-buildpack-authors/concepts/targets/) identifies the kind of build and run base images the buildpack will work with.
The stack ID (deprecated) uniquely identifies a build and run image configuration the buildpack will work with. This example can be run on Ubuntu Jammy.
The stack ID (deprecated) uniquely identifies a build and run image configuration the buildpack will work with. This example can be run on Ubuntu Noble.

### `detect` and `build`

Expand Down Expand Up @@ -102,15 +102,15 @@ Set your default [builder][builder] by running the following:

<!-- test:exec -->
```bash
pack config default-builder cnbs/sample-builder:jammy
pack config default-builder cnbs/sample-builder:noble
```
<!--+- "{{execute}}"+-->

Tell pack to trust our default builder:

<!-- test:exec -->
```bash
pack config trusted-builders add cnbs/sample-builder:jammy
pack config trusted-builders add cnbs/sample-builder:noble
```
<!--+- "{{execute}}"+-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We need a Dockerfile similar to the following:

```Dockerfile
# Define the base image
FROM ubuntu:jammy
FROM ubuntu:noble

# Install packages that we want to make available at build time
RUN apt-get update && \
Expand All @@ -44,7 +44,7 @@ LABEL io.buildpacks.base.distro.version="your distro version"

### Define the base image

We start with `ubuntu:jammy` as our base image.
We start with `ubuntu:noble` as our base image.
You can use any operating system, operating system distribution, and operating system distribution version of your choosing,
as long as they are supported by the available buildpacks.

Expand All @@ -71,5 +71,5 @@ To determine which values to provide, see [targets](/docs/for-buildpack-authors/
## Build the build base image

```bash
docker build . -t cnbs/sample-base-build:jammy
docker build . -t cnbs/sample-base-build:noble
```
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ uri = "docker://cnbs/sample-package:hello-universe"

# Base images used to create the builder
[build]
image = "cnbs/sample-base-build:jammy"
image = "cnbs/sample-base-build:noble"
[run]
[[run.images]]
image = "cnbs/sample-base-run:jammy"
mirrors = ["other-registry.example.com/cnbs/sample-base-run:jammy"]
image = "cnbs/sample-base-run:noble"
mirrors = ["other-registry.example.com/cnbs/sample-base-run:noble"]

# Stack (deprecated) used to create the builder
[stack]
id = "io.buildpacks.samples.stacks.jammy"
id = "io.buildpacks.samples.stacks.noble"
# This image is used at runtime
run-image = "cnbs/sample-base-run:jammy"
run-image-mirrors = ["other-registry.example.com/cnbs/sample-base-run:jammy"]
run-image = "cnbs/sample-base-run:noble"
run-image-mirrors = ["other-registry.example.com/cnbs/sample-base-run:noble"]
# This image is used at build-time
build-image = "cnbs/sample-base-build:jammy"
build-image = "cnbs/sample-base-build:noble"
```

### 2. Create builder
Expand All @@ -77,7 +77,7 @@ Creating a builder is now as simple as running the following command:

```bash
# create builder
pack builder create my-builder:jammy --config ./builder.toml
pack builder create my-builder:noble --config ./builder.toml
```

> **TIP:** `builder create` has a `--publish` flag that can be used to publish the generated builder image to a registry.
Expand All @@ -89,7 +89,7 @@ pack builder create my-builder:jammy --config ./builder.toml
Let's go a little further and use our builder to [`build`][build] an app by running:

```bash
pack build my-app --builder my-builder:jammy --path samples/apps/java-maven/
pack build my-app --builder my-builder:noble --path samples/apps/java-maven/
```

### 4. Running the app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We need a Dockerfile similar to the following:

```Dockerfile
# Define the base image
FROM ubuntu:jammy
FROM ubuntu:noble

# Install packages that we want to make available at run time
RUN apt-get update && \
Expand All @@ -40,7 +40,7 @@ LABEL io.buildpacks.base.distro.version="your distro version"

### Define the base image

We start with `ubuntu:jammy` as our base image.
We start with `ubuntu:noble` as our base image.
You can use any operating system, operating system distribution, and operating system distribution version of your choosing,
as long as your application will run there.

Expand All @@ -62,5 +62,5 @@ To determine which values to provide, see [targets](/docs/for-buildpack-authors/
## Build the run base image

```bash
docker build . -t cnbs/sample-base-run:jammy
docker build . -t cnbs/sample-base-run:noble
```
12 changes: 6 additions & 6 deletions content/docs/for-platform-operators/how-to/build-inputs/stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Before we get started, make sure you've got the following installed:

## Creating a custom stack

We will create a sample stack based on `Ubuntu Jammy Jellyfish`. To create a custom stack, we need to create customized build and run images.
We will create a sample stack based on `Ubuntu Noble Jellyfish`. To create a custom stack, we need to create customized build and run images.
To find out how, see [create a build base image](/docs/for-platform-operators/how-to/build-inputs/create-builder/build-base/) and [create a run base image](/docs/for-platform-operators/how-to/build-inputs/create-builder/run-base/), then come back here.

## Choose your stack ID
Expand All @@ -41,10 +41,10 @@ Choose a stack ID to uniquely identify your stack. The stack ID:
* should use reverse domain notation to avoid name collisions - i.e. buildpacks.io will be io.buildpacks.

Example stack IDs:
* `io.buildpacks.stacks.bionic`
* `io.buildpacks.stacks.jammy`
* `io.buildpacks.samples.stacks.bionic`
* `io.buildpacks.samples.stacks.jammy`
* `io.buildpacks.stacks.noble`
* `io.buildpacks.stacks.noble`
* `io.buildpacks.samples.stacks.noble`
* `io.buildpacks.samples.stacks.noble`

## Label your images

Expand Down Expand Up @@ -117,7 +117,7 @@ When validating whether the buildpack's mixins are satisfied by a stack, the fol

```toml
[[stacks]]
id = "io.buildpacks.stacks.jammy"
id = "io.buildpacks.stacks.noble"
mixins = ["build:git", "run:imagemagick", "wget"]
```

Expand Down
Loading

0 comments on commit 183a23f

Please sign in to comment.