Skip to content

Commit

Permalink
Refactor paths in docker-bake.hcl for ci-agent image build
Browse files Browse the repository at this point in the history
  • Loading branch information
Artuomka committed Oct 21, 2024
1 parent 58685f1 commit fa625bf
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-agent.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: ci-agent

on:
push:
Expand All @@ -17,7 +17,7 @@ jobs:
- name: Create matrix
id: platforms
run: |
echo "matrix=$(docker buildx bake image-all -f rocketadmin-agent/docker-bake.hcl --print | jq -cr '.target."image-all".platforms')" >>${GITHUB_OUTPUT}
echo "matrix=$(docker buildx bake image-all -f docker-bake-agent.hcl --print | jq -cr '.target."image-all".platforms')" >>${GITHUB_OUTPUT}
- name: Show matrix
run: |
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
uses: docker/bake-action@v5
with:
files: |
./rocketadmin-agent/docker-bake.hcl
./docker-bake-agent.hcl
/tmp/bake-meta.json
targets: image
set: |
Expand Down
31 changes: 31 additions & 0 deletions docker-bake-agent.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
variable "DEFAULT_TAG" {
default = "rocketadmin-agent:local"
}

# Special target: https://github.com/docker/metadata-action#bake-definition
target "docker-metadata-action" {
tags = ["${DEFAULT_TAG}"]
}

group "default" {
targets = ["image-local"]
}

target "image-local" {
context = "."
dockerfile = "Dockerfile.rocketadmin-agent"
}

target "image" {
inherits = ["docker-metadata-action"]
context = "."
dockerfile = "Dockerfile.rocketadmin-agent"
}

target "image-all" {
inherits = ["image"]
platforms = [
"linux/amd64",
"linux/arm64"
]
}

0 comments on commit fa625bf

Please sign in to comment.