2021-05-28 18:51:41 +02:00
|
|
|
# Use this file from the top of the repo, with `-f ci/release-image/docker-bake.hcl`
|
|
|
|
|
|
|
|
# Uses env var VERSION if set;
|
|
|
|
# normally, this is set by ci/lib.sh
|
|
|
|
variable "VERSION" {
|
|
|
|
default = "latest"
|
|
|
|
}
|
|
|
|
|
2022-10-24 20:41:19 +02:00
|
|
|
variable "DOCKER_REGISTRY" {
|
|
|
|
default = "docker.io/codercom/code-server"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "GITHUB_REGISTRY" {
|
|
|
|
default = "ghcr.io/coder/code-server"
|
|
|
|
}
|
|
|
|
|
2021-05-28 18:51:41 +02:00
|
|
|
group "default" {
|
2022-10-24 20:41:19 +02:00
|
|
|
targets = [
|
2023-12-18 22:30:16 +01:00
|
|
|
"code-server-debian-12",
|
2022-10-24 20:41:19 +02:00
|
|
|
"code-server-ubuntu-focal",
|
2024-05-24 22:02:32 +02:00
|
|
|
"code-server-ubuntu-noble",
|
2024-02-08 22:31:50 +01:00
|
|
|
"code-server-fedora-39",
|
|
|
|
"code-server-opensuse-tumbleweed",
|
2022-10-24 20:41:19 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
function "prepend_hyphen_if_not_null" {
|
|
|
|
params = [tag]
|
|
|
|
result = notequal("","${tag}") ? "-${tag}" : "${tag}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# use empty tag (tag="") to generate default tags
|
|
|
|
function "gen_tags" {
|
|
|
|
params = [registry, tag]
|
|
|
|
result = notequal("","${registry}") ? [
|
|
|
|
notequal("", "${tag}") ? "${registry}:${tag}" : "${registry}:latest",
|
|
|
|
notequal("latest",VERSION) ? "${registry}:${VERSION}${prepend_hyphen_if_not_null(tag)}" : "",
|
|
|
|
] : []
|
|
|
|
}
|
|
|
|
|
|
|
|
# helper function to generate tags for docker registry and github registry.
|
|
|
|
# set (DOCKER|GITHUB)_REGISTRY="" to disable corresponding registry
|
|
|
|
function "gen_tags_for_docker_and_ghcr" {
|
|
|
|
params = [tag]
|
|
|
|
result = concat(
|
|
|
|
gen_tags("${DOCKER_REGISTRY}", "${tag}"),
|
|
|
|
gen_tags("${GITHUB_REGISTRY}", "${tag}"),
|
|
|
|
)
|
2021-05-28 18:51:41 +02:00
|
|
|
}
|
|
|
|
|
2023-12-18 22:30:16 +01:00
|
|
|
target "code-server-debian-12" {
|
2021-05-28 18:51:41 +02:00
|
|
|
dockerfile = "ci/release-image/Dockerfile"
|
2022-10-24 20:41:19 +02:00
|
|
|
tags = concat(
|
|
|
|
gen_tags_for_docker_and_ghcr(""),
|
|
|
|
gen_tags_for_docker_and_ghcr("debian"),
|
2023-12-18 22:30:16 +01:00
|
|
|
gen_tags_for_docker_and_ghcr("bookworm"),
|
2022-10-24 20:41:19 +02:00
|
|
|
)
|
|
|
|
platforms = ["linux/amd64", "linux/arm64"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "code-server-ubuntu-focal" {
|
|
|
|
dockerfile = "ci/release-image/Dockerfile"
|
|
|
|
tags = concat(
|
|
|
|
gen_tags_for_docker_and_ghcr("ubuntu"),
|
|
|
|
gen_tags_for_docker_and_ghcr("focal"),
|
|
|
|
)
|
|
|
|
args = {
|
|
|
|
BASE = "ubuntu:focal"
|
|
|
|
}
|
2021-07-29 20:01:46 +02:00
|
|
|
platforms = ["linux/amd64", "linux/arm64"]
|
2021-05-28 18:51:41 +02:00
|
|
|
}
|
2024-02-08 22:31:50 +01:00
|
|
|
|
2024-05-24 22:02:32 +02:00
|
|
|
target "code-server-ubuntu-noble" {
|
|
|
|
dockerfile = "ci/release-image/Dockerfile"
|
|
|
|
tags = concat(
|
|
|
|
gen_tags_for_docker_and_ghcr("noble"),
|
|
|
|
)
|
|
|
|
args = {
|
|
|
|
BASE = "ubuntu:noble"
|
|
|
|
}
|
|
|
|
platforms = ["linux/amd64", "linux/arm64"]
|
|
|
|
}
|
|
|
|
|
2024-02-08 22:31:50 +01:00
|
|
|
target "code-server-fedora-39" {
|
|
|
|
dockerfile = "ci/release-image/Dockerfile.fedora"
|
|
|
|
tags = concat(
|
|
|
|
gen_tags_for_docker_and_ghcr("fedora"),
|
|
|
|
gen_tags_for_docker_and_ghcr("39"),
|
|
|
|
)
|
|
|
|
args = {
|
|
|
|
BASE = "fedora:39"
|
|
|
|
}
|
|
|
|
platforms = ["linux/amd64", "linux/arm64"]
|
|
|
|
}
|
|
|
|
|
|
|
|
target "code-server-opensuse-tumbleweed" {
|
|
|
|
dockerfile = "ci/release-image/Dockerfile.opensuse"
|
|
|
|
tags = concat(
|
|
|
|
gen_tags_for_docker_and_ghcr("opensuse"),
|
|
|
|
gen_tags_for_docker_and_ghcr("tumbleweed"),
|
|
|
|
)
|
|
|
|
args = {
|
|
|
|
BASE = "opensuse/tumbleweed"
|
|
|
|
}
|
|
|
|
platforms = ["linux/amd64", "linux/arm64"]
|
|
|
|
}
|