@@ -53,17 +53,9 @@ To build a custom image we add the following content in a local file with name
5353` bake.hcl ` :
5454
5555``` hcl
56- variable "environment" {
57- default = "production"
58- }
59-
60- variable "registry" {
61- default = "your.repo.url/cnpg"
62- }
63-
64- platforms = [
65- "linux/amd64",
66- ]
56+ platforms = [
57+ "linux/amd64",
58+ ]
6759
6860extensions = [
6961 "dbgsym",
130122
131123Starting at the beginning of the file:
132124
133- - The ` environment ` variable is set to ` production ` for all of my images,
134- because I use the same image to stage it through dev/test/prod.
135- - The ` registry ` variable contains the repo upload url, so I don't have to add
136- this information every time I build an image.
137125- The ` platforms ` variable is ` linux/amd64 ` for all of my images.
138126- The ` extensions ` variable contains some extensions I use regularly.
139127- The ` dockerfile-inline ` part is extended with binaries, some of them are handy
@@ -149,9 +137,15 @@ this information every time I build an image.
149137We can now build the image using the following command:
150138
151139``` bash
152- docker buildx bake -f docker-bake.hcl -f cwd://bake.hcl " https://github.com/cloudnative-pg/postgres-containers.git" myimage
140+ environment=production registry=your.repo.url docker buildx bake -f docker-bake.hcl -f cwd://bake.hcl " https://github.com/cloudnative-pg/postgres-containers.git" myimage
153141```
154142
143+ - The ` environment ` variable is set to ` production ` for all of my images,
144+ because I use the same image to stage it through dev/test/prod.
145+ - The ` registry ` variable contains the repo upload url, so the images get
146+ uploaded there instead of the ` localhost:5000 ` registry used in the
147+ [ hcl file] ( https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg.github.io/refs/heads/main/content/blog/building-images-bake/bake.hcl ) .
148+
155149### Step 3: Use it
156150
157151The only missing step to use the images is to update your
0 commit comments