Skip to content

Commit

Permalink
Try fixing remote docker build cache
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVanDyck committed Dec 17, 2024
1 parent d764b23 commit 4775f2f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,9 @@ jobs:
--set="${docker_name}.labels.git_tag=${GIT_TAG}" \
--set="${docker_name}.labels.git_hash=${{ github.sha }}" \
--set="custom-gradle.cache-to=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-gradle:${CACHE_TAG},image-manifest=true,mode=max" \
--set="custom-gradle.cache-from=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-gradle:${CACHE_TAG},image-manifest=true" \
--set="custom-maven.cache-to=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-maven:${CACHE_TAG},image-manifest=true,mode=max" \
--set="custom-maven.cache-from=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-maven:${CACHE_TAG},image-manifest=true" \
--set="tomcat-base.cache-to=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/tomcat-base:${CACHE_TAG},image-manifest=true,mode=max" \
--set="tomcat-base.cache-from=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/tomcat-base:${CACHE_TAG},image-manifest=true" \
--set="${docker_name}.cache-to=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/${docker_name}:${CACHE_TAG},image-manifest=true,mode=max" \
--set="${docker_name}.cache-from=type=registry,ref=632683202044.dkr.ecr.eu-west-1.amazonaws.com/${docker_name}:${CACHE_TAG},image-manifest=true"
# Create Git Tag
echo "Creating Git Tag: ${GIT_TAG}"
Expand Down
20 changes: 20 additions & 0 deletions docker/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ variable "TAG" {

target "custom-gradle" {
context = "./gradle"
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-gradle:cache-github"]
tags = ["custom-gradle:${TAG}"]
}

target "custom-maven" {
context = "./maven"
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/custom-maven:cache-github"]
tags = ["custom-maven:${TAG}"]
}


target "tomcat-base" {
context = "./tomcat"
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/tomcat-base:cache-github"]
tags = ["tomcat:${TAG}"]
target = "base"
}
Expand Down Expand Up @@ -49,6 +52,7 @@ target "alerts" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/alerts:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/alerts:${TAG}"]
}

Expand All @@ -58,6 +62,7 @@ target "apikey" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/apikey:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/apikey:${TAG}"]
}

Expand All @@ -67,6 +72,7 @@ target "bie-hub" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/bie-hub:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/bie-hub:${TAG}"]
}

Expand All @@ -76,6 +82,7 @@ target "bie-index" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/bie-index:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/bie-index:${TAG}"]
}

Expand All @@ -85,6 +92,7 @@ target "biocache-hub" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/biocache-hub:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/biocache-hub:${TAG}"]
}

Expand All @@ -94,6 +102,7 @@ target "biocache-service" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/biocache-service:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/biocache-service:${TAG}"]
}

Expand All @@ -103,6 +112,7 @@ target "collectory" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/collectory:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/collectory:${TAG}"]
}

Expand All @@ -112,6 +122,7 @@ target "doi-service" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/doi-service:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/doi-service:${TAG}"]
}

Expand All @@ -121,6 +132,7 @@ target "image-service" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/image-service:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/image-service:${TAG}"]
}

Expand All @@ -130,6 +142,7 @@ target "logger" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/logger:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/logger:${TAG}"]
}

Expand All @@ -138,6 +151,7 @@ target "namematching-service" {
contexts = {
"custom-maven" = "target:custom-maven"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/namematching-service:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/namematching-service:${TAG}"]
}

Expand All @@ -146,6 +160,7 @@ target "pipelines" {
contexts = {
"custom-maven" = "target:custom-maven"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/la-pipelines:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/la-pipelines:${TAG}"]
}

Expand All @@ -155,6 +170,7 @@ target "regions" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/regions:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/regions:${TAG}"]
}

Expand All @@ -172,6 +188,7 @@ target "spatial-hub" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/spatial-hub:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/spatial-hub:${TAG}"]
}

Expand All @@ -181,6 +198,7 @@ target "spatial-service" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/spatial-service:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/spatial-service:${TAG}"]
}

Expand All @@ -190,6 +208,7 @@ target "species-list" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/species-list:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/species-list:${TAG}"]
}

Expand All @@ -199,6 +218,7 @@ target "userdetails" {
"custom-gradle" = "target:custom-gradle"
"tomcat-base" = "target:tomcat-base"
}
cache_from = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/userdetails:cache-github"]
tags = ["632683202044.dkr.ecr.eu-west-1.amazonaws.com/userdetails:${TAG}"]
}

Expand Down

0 comments on commit 4775f2f

Please sign in to comment.