@@ -230,8 +230,8 @@ jobs:
230
230
targets: build
231
231
` ` `
232
232
233
- Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with
234
- `refs/tags/v1.2.3` ref :
233
+ Content of `${{ steps.meta.outputs.bake-file }}` file, combining tags and
234
+ labels, will look like this with `refs/tags/v1.2.3` ref :
235
235
236
236
` ` ` json
237
237
{
@@ -262,6 +262,22 @@ Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with
262
262
}
263
263
` ` `
264
264
265
+ You can also use the `bake-file-tags` and `bake-file-labels` outputs if you
266
+ just want to use tags and/or labels respectively. The following example is
267
+ similar to the previous one :
268
+
269
+ ` ` ` yaml
270
+ -
271
+ name: Build
272
+ uses: docker/bake-action@v3
273
+ with:
274
+ files: |
275
+ ./docker-bake.hcl
276
+ ${{ steps.meta.outputs.bake-file-tags }}
277
+ ${{ steps.meta.outputs.bake-file-labels }}
278
+ targets: build
279
+ ` ` `
280
+
265
281
# # Customizing
266
282
267
283
# ## inputs
@@ -276,36 +292,38 @@ The following inputs can be used as `step.with` keys:
276
292
> org.opencontainers.image.vendor=MyCompany
277
293
> ```
278
294
279
- | Name | Type | Description |
280
- |--------------------- |--------|-------------------------------------------------------------------------------|
281
- | `context` | String | Where to get context data. Allowed options are : ` workflow` (default), `git`. |
282
- | `images` | List | List of Docker images to use as base name for tags |
283
- | `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
284
- | `flavor` | List | [Flavor](#flavor-input) to apply |
285
- | `labels` | List | List of custom labels |
286
- | `sep-tags` | String | Separator to use for tags output (default `\n`) |
287
- | `sep-labels` | String | Separator to use for labels output (default `\n`) |
288
- | `bake-target` | String | Bake target name (default `docker-metadata-action`) |
295
+ | Name | Type | Description |
296
+ |---------------|--------|-------------------------------------------------------------------------------|
297
+ | `context` | String | Where to get context data. Allowed options are : ` workflow` (default), `git`. |
298
+ | `images` | List | List of Docker images to use as base name for tags |
299
+ | `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
300
+ | `flavor` | List | [Flavor](#flavor-input) to apply |
301
+ | `labels` | List | List of custom labels |
302
+ | `sep-tags` | String | Separator to use for tags output (default `\n`) |
303
+ | `sep-labels` | String | Separator to use for labels output (default `\n`) |
304
+ | `bake-target` | String | Bake target name (default `docker-metadata-action`) |
289
305
290
306
# ## outputs
291
307
292
308
The following outputs are available :
293
309
294
- | Name | Type | Description |
295
- |-------------|--------|----------------------------------------------------------------------------|
296
- | `version` | String | Docker image version |
297
- | `tags` | String | Docker tags |
298
- | `labels` | String | Docker labels |
299
- | `json` | String | JSON output of tags and labels |
300
- | `bake-file` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path |
310
+ | Name | Type | Description |
311
+ |--------------------|--------|-------------------------------------------------------------------------------------------------|
312
+ | `version` | String | Docker image version |
313
+ | `tags` | String | Docker tags |
314
+ | `labels` | String | Docker labels |
315
+ | `json` | String | JSON output of tags and labels |
316
+ | `bake-file-tags` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path with tags |
317
+ | `bake-file-labels` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path with labels |
301
318
302
319
Alternatively, each output is also exported as an environment variable :
303
320
304
321
* `DOCKER_METADATA_OUTPUT_VERSION`
305
322
* `DOCKER_METADATA_OUTPUT_TAGS`
306
323
* `DOCKER_METADATA_OUTPUT_LABELS`
307
324
* `DOCKER_METADATA_OUTPUT_JSON`
308
- * `DOCKER_METADATA_OUTPUT_BAKE_FILE`
325
+ * `DOCKER_METADATA_OUTPUT_BAKE_FILE_TAGS`
326
+ * `DOCKER_METADATA_OUTPUT_BAKE_FILE_LABELS`
309
327
310
328
So it can be used with our [Docker Build Push action](https://github.com/docker/build-push-action/) :
311
329
0 commit comments