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
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:
105
106
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.
107
109
108
110
In the command above, `-f cwd://bake.hcl` is the local file that we created in Step 1, and
109
111
`-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
151
153
152
154
### Dockerfile file
153
155
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.
155
159
156
-
## There's more!
160
+
## Making your images for specific architectures
157
161
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.
159
165
160
166
```hcl
161
167
platforms = ["linux/amd64"]
162
168
```
163
169
164
-
This will override the platforms variable, so the image will be built for a single platform only.
165
-
166
170
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