Skip to content

Commit

Permalink
Merge pull request #868 from rocket-admin/backend_rework_agent_docker…
Browse files Browse the repository at this point in the history
…file

Refactor paths in docker-bake.hcl for rocket admin agent image build
  • Loading branch information
Artuomka authored Oct 21, 2024
2 parents 1c5cbc2 + fa625bf commit 974c067
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 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"
]
}
6 changes: 3 additions & 3 deletions rocketadmin-agent/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ variable "DEFAULT_TAG" {
default = "rocketadmin-agent:local"
}

// Special target: https://github.com/docker/metadata-action#bake-definition
# Special target: https://github.com/docker/metadata-action#bake-definition
target "docker-metadata-action" {
tags = ["${DEFAULT_TAG}"]
}
Expand All @@ -12,13 +12,13 @@ group "default" {
}

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

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

Expand Down

0 comments on commit 974c067

Please sign in to comment.