You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/building-images-bake/index.md
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,6 @@
2
2
title: "Creating a custom container image for CloudNativePG v2.0"
3
3
date: 2025-07-22
4
4
draft: false
5
-
image:
6
-
url:
7
-
attribution:
8
5
author: jgonzalez
9
6
tags:
10
7
- blog
@@ -38,8 +35,6 @@ parallel.
38
35
- A Bake file, using the one provided in the [CloudNativePG repository](https://github.com/cloudnative-pg/postgres-containers/blob/main/docker-bake.hcl) as a base.
39
36
- A second, local Bake file to override the base configuration—this lets you apply your custom changes and build the container images accordingly.
40
37
41
-
Baking time: 5 minutes.
42
-
43
38
## Instructions
44
39
45
40
### Step 1: Prepare local Bake file
@@ -83,8 +78,10 @@ EOT
83
78
84
79
There are a few important points to highlight:
85
80
86
-
- The `extensions` variable is a list of extensions that we want to include in the image. In our recipe we are using `pgvector`, but you can add any others as needed.
87
-
- The `dockerfile-inline` variable contains our Dockerfile definition, which cannot be used remotely. We will explain why later.
81
+
- The `extensions` variable is a list of extensions that we want to include in the image. In our recipe we are using
82
+
`pgvector`, but you can add any others as needed.
83
+
- The `dockerfile-inline` variable contains our Dockerfile definition, which cannot be used remotely. We will explain
84
+
why later.
88
85
- The `target` and the `tgt` values share the same name, but you can use any name you prefer.
89
86
- The `pgVersion` variable is a list specifying the PostgreSQL version(s) in MAJOR.MINOR format.
90
87
- The `name` field is used to identify individual entries in the matrix we’ve defined.
@@ -110,7 +107,8 @@ functions and default targets, then attach a local Bake file to override any def
110
107
In the command above, `-f cwd://bake.hcl` is the local file that we created in Step 1, and
111
108
`-f docker-bake.hcl` is the remote file in the git repo, that we're using to build the image.
112
109
113
-
You can explore more about all the content generated and used inside the Bake file by appending the `--print` flag, as in the following command:
110
+
You can explore more about all the content generated and used inside the Bake file by appending the `--print` flag, as
0 commit comments