Skip to content

Commit c5db896

Browse files
committed
chore: more changes
Signed-off-by: Jonathan Gonzalez V. <jonathan.abdiel@gmail.com>
1 parent 551c96a commit c5db896

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

  • content/blog/building-images-bake

content/blog/building-images-bake/index.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ docker buildx bake -f docker-bake.hcl -f cwd://bake.hcl "https://github.com/clou
101101
```
102102

103103
This will build the image for the bake matrix we previously created, and will try to push the image to the registry at
104-
`localhost:5000`, which is the default registry defined for testing environments in the parent Bake file. Let's explain the full command:
104+
`localhost:5000`, which is the default registry defined for testing environments in the parent Bake file. Let's explain
105+
the full command:
105106

106-
As outlined in the [Bake documentation on remote definitions](https://docs.docker.com/build/bake/remote-definition/), you can use a remote Bake file that includes functions and default targets, then attach a local Bake file to override any default values as needed.
107+
As outlined in the [Bake documentation on remote definitions](https://docs.docker.com/build/bake/remote-definition/), you can use a remote Bake file that includes
108+
functions and default targets, then attach a local Bake file to override any default values as needed.
107109

108110
In the command above, `-f cwd://bake.hcl` is the local file that we created in Step 1, and
109111
`-f docker-bake.hcl` is the remote file in the git repo, that we're using to build the image.
@@ -151,16 +153,18 @@ merged, meaning that the new elements will be added, and the existing ones will
151153

152154
### Dockerfile file
153155

154-
The Dockerfile is defined as a heredoc string due to Bake's limitation in overriding a remote Dockerfile with a local one. However, this approach still lets us modify the FROM directive, allowing us to base our image directly on the CloudNativePG images and add only the specific extensions we need—without rebuilding all of them.
156+
The Dockerfile is defined as a heredoc string due to Bake's limitation in overriding a remote Dockerfile with a local
157+
one. However, this approach still lets us modify the FROM directive, allowing us to base our image directly on the
158+
CloudNativePG images and add only the specific extensions we need—without rebuilding all of them.
155159

156-
## There's more!
160+
## Making your images for specific architectures
157161

158-
You may want to avoid building arm64 images by adding the following:
162+
By default, we build the images for `amd64` and `arm64` architectures, which is the recommended approach for most users.
163+
However, if you want to build images for your specific architecture and so, saving some space, you can override the
164+
`platforms` variable in your local Bake file.
159165

160166
```hcl
161167
platforms = ["linux/amd64"]
162168
```
163169

164-
This will override the platforms variable, so the image will be built for a single platform only.
165-
166170
If you’d like to build everything into your own repository while managing the same tags, that’s also possible. We may cover that in a future post.

0 commit comments

Comments
 (0)