From 58685f1dffc158a1f0c32202323aacb3f914c038 Mon Sep 17 00:00:00 2001 From: Artem Niehrieiev Date: Mon, 21 Oct 2024 19:14:45 +0000 Subject: [PATCH 1/2] Refactor paths in docker-bake.hcl for rocket admin agent image build --- rocketadmin-agent/docker-bake.hcl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rocketadmin-agent/docker-bake.hcl b/rocketadmin-agent/docker-bake.hcl index 9a40f9d2..50015167 100644 --- a/rocketadmin-agent/docker-bake.hcl +++ b/rocketadmin-agent/docker-bake.hcl @@ -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}"] } @@ -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" } From fa625bf77c34efda84aa336d99c11523ccac26d8 Mon Sep 17 00:00:00 2001 From: Artem Niehrieiev Date: Mon, 21 Oct 2024 19:31:26 +0000 Subject: [PATCH 2/2] Refactor paths in docker-bake.hcl for ci-agent image build --- .github/workflows/build-agent.yml | 6 +++--- docker-bake-agent.hcl | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 docker-bake-agent.hcl diff --git a/.github/workflows/build-agent.yml b/.github/workflows/build-agent.yml index 01d0099b..ecfbb0ef 100644 --- a/.github/workflows/build-agent.yml +++ b/.github/workflows/build-agent.yml @@ -1,4 +1,4 @@ -name: ci +name: ci-agent on: push: @@ -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: | @@ -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: | diff --git a/docker-bake-agent.hcl b/docker-bake-agent.hcl new file mode 100644 index 00000000..d879c059 --- /dev/null +++ b/docker-bake-agent.hcl @@ -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" + ] +} \ No newline at end of file