mirror of
https://github.com/docker/metadata-action.git
synced 2024-11-16 17:15:40 +01:00
Merge pull request #395 from crazy-max/bake-cwd-prefix
docs: using bake with remote and local metadata definition
This commit is contained in:
commit
c314eea2b2
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@ -522,3 +522,30 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Print envs
|
name: Print envs
|
||||||
run: env|sort
|
run: env|sort
|
||||||
|
|
||||||
|
bake-cwd:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: docker_meta
|
||||||
|
uses: ./
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/bake-action@v4
|
||||||
|
with:
|
||||||
|
source: "{{defaultContext}}"
|
||||||
|
files: |
|
||||||
|
./test/docker-bake.hcl
|
||||||
|
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||||
|
cwd://${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||||
|
targets: |
|
||||||
|
release
|
||||||
|
23
README.md
23
README.md
@ -223,7 +223,7 @@ jobs:
|
|||||||
type=sha
|
type=sha
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v3
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./docker-bake.hcl
|
./docker-bake.hcl
|
||||||
@ -270,7 +270,7 @@ similar to the previous one:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v3
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./docker-bake.hcl
|
./docker-bake.hcl
|
||||||
@ -279,6 +279,23 @@ similar to the previous one:
|
|||||||
targets: build
|
targets: build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you're building a [remote Bake definition](https://docs.docker.com/build/bake/remote-definition/)
|
||||||
|
using a [Git context](https://github.com/docker/bake-action?tab=readme-ov-file#git-context),
|
||||||
|
you must specify the location of the metadata-only bake file using a `cwd://`
|
||||||
|
prefix:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/bake-action@v4
|
||||||
|
with:
|
||||||
|
source: "${{ github.server_url }}/${{ github.repository }}.git#${{ github.ref }}"
|
||||||
|
files: |
|
||||||
|
./docker-bake.hcl
|
||||||
|
cwd://${{ steps.meta.outputs.bake-file }}
|
||||||
|
targets: build
|
||||||
|
```
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
@ -948,7 +965,7 @@ The same can be done with the [`bake-action`](https://github.com/docker/bake-act
|
|||||||
images: name/app
|
images: name/app
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v3
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./docker-bake.hcl
|
./docker-bake.hcl
|
||||||
|
Loading…
Reference in New Issue
Block a user