Skip to content

Commit

Permalink
Update docker bake build
Browse files Browse the repository at this point in the history
  • Loading branch information
bubylou committed Jan 7, 2025
1 parent f71d348 commit f862766
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: docker/[email protected]
with:
push: ${{ github.event_name != 'pull_request' }}
targets: release
targets: release-all
env:
TAG: ${{ github.ref_name }}

Expand Down
46 changes: 22 additions & 24 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
group "default" {
targets = ["image-dev"]
targets = ["build", "build-wine"]
}

group "release" {
targets = ["image-release", "image-wine"]
group "release-all" {
targets = ["release", "release-wine"]
}

variable "REPO" {
Expand All @@ -20,36 +20,34 @@ function "tags" {
"docker.io/${REPO}:latest${suffix}", "docker.io/${REPO}:${TAG}${suffix}"]
}

target "image-release" {
target "build" {
context = "."
dockerfile = "Dockerfile"
cache-from = ["type=registry,ref=ghcr.io/${REPO}"]
cache-to = ["type=inline"]
tags = tags("")
}

target "build-wine" {
inherits = ["build"]
args = { RELEASE = "wine" }
tags = tags("-wine")
}

target "release" {
inherits = ["build"]
context = "."
dockerfile = "Dockerfile"
cache-from = ["type=gha"]
cache-to = ["type=gha,mode=max"]
labels = {
"org.opencontainers.image.source" = "https://github.com/bubylou/steamcmd-docker"
"org.opencontainers.image.authors" = "Nicholas Malcolm <[email protected]>"
"org.opencontainers.image.licenses" = "MIT"
}
attest = [
"type=provenance,mode=max",
"type=sbom"
]

platforms = ["linux/amd64"]
platforms = ["linux/amd64", "linux/arm64", "linux/arm"]
tags = tags("")
}

target "image-wine" {
inherits = ["image-release"]
args = {
RELEASE = "wine"
}
tags = tags("-wine")
}

target "image-dev" {
inherits = ["image-wine"]
cache-from = ["type=registry,ref=ghcr.io/${REPO}"]
cache-to = ["type=inline"]
tags = tags("-dev")
target "release-wine" {
inherits = ["build-wine", "release"]
}

0 comments on commit f862766

Please sign in to comment.