Skip to content

Commit

Permalink
Add docker baking (#1137)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
  • Loading branch information
timja and MarkEWaite authored Jul 5, 2021
1 parent 451591c commit 12fb253
Show file tree
Hide file tree
Showing 2 changed files with 165 additions and 9 deletions.
28 changes: 19 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,37 @@ shellcheck:
jenkins-support \
*.sh
build:
@for d in ${DOCKERFILES} ; do \
docker build --file "$${d}" . ; \
done
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/amd64' --load linux

build-arm64:
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/arm64' --load linux-arm64

build-s390x:
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/s390x' --load linux-s390x

build-ppc64le:
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/ppc64le' --load linux-ppc64le

build-multiarch:
docker buildx bake -f docker-bake.hcl --load linux

build-debian:
docker build --file 8/debian/buster/hotspot/Dockerfile .
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/amd64' --load debian_jdk8

build-alpine:
docker build --file 8/alpine/hotspot/Dockerfile .
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/amd64' --load alpine_jdk8

build-slim:
docker build --file 8/debian/buster-slim/hotspot/Dockerfile .
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/amd64' --load debian_slim_jdk8

build-jdk11:
docker build --file 11/debian/buster/hotspot/Dockerfile .
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/amd64' --load debian_slim_jdk8

build-centos:
docker build --file 8/centos/centos8/hotspot/Dockerfile .
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/amd64' --load centos7_jdk8

build-centos7:
docker build --file 8/centos/centos7/hotspot/Dockerfile .
docker buildx bake -f docker-bake.hcl --set '*.platform=linux/amd64' --load centos8_jdk8

bats:
git clone -b v1.3.0 https://github.com/bats-core/bats-core bats
Expand Down
146 changes: 146 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
// TODO handle latest / latest-variant / latest-lts

group "linux" {
targets = [
"alpine_jdk8",
"centos7_jdk8",
"centos8_jdk8",
"debian_jdk8",
"debian_jdk11",
"debian_slim_jdk8",
]
}

group "linux-arm64" {
targets = [
"centos8_jdk8",
"debian_jdk8",
"debian_jdk11",
"debian_slim_jdk8",
]
}

group "linux-s390x" {
targets = [
"debian_jdk11",
]
}

group "linux-ppc64le" {
targets = [
"centos8_jdk8",
"debian_jdk8",
"debian_jdk11",
"debian_slim_jdk8",
]
}

group "windows" {
targets = [
"windows_1809_jdk11",
"windows_2019_jdk11",
]
}

variable "JENKINS_VERSION" {
default = "2.300"
}

variable "JENKINS_SHA" {
default = "2f6aa548373b038af4fb6a4d6eaa5d13679510008f1712532732bf77c55b9670"
}

variable "REGISTRY" {
default = "docker.io"
}

variable "JENKINS_REPO" {
default = "jenkins/jenkins"
}

target "alpine_jdk8" {
dockerfile = "8/alpine/hotspot/Dockerfile"
context = "."
args = {
JENKINS_VERSION = JENKINS_VERSION
JENKINS_SHA = JENKINS_SHA
}
tags = ["${REGISTRY}/${JENKINS_REPO}:${JENKINS_VERSION}-alpine"]
platforms = ["linux/amd64"]
}

target "centos7_jdk8" {
dockerfile = "8/centos/centos7/hotspot/Dockerfile"
context = "."
args = {
JENKINS_VERSION = JENKINS_VERSION
JENKINS_SHA = JENKINS_SHA
}
tags = ["${REGISTRY}/${JENKINS_REPO}:${JENKINS_VERSION}-centos7"]
platforms = ["linux/amd64"]
}

target "centos8_jdk8" {
dockerfile = "8/centos/centos8/hotspot/Dockerfile"
context = "."
args = {
JENKINS_VERSION = JENKINS_VERSION
JENKINS_SHA = JENKINS_SHA
}
tags = ["${REGISTRY}/${JENKINS_REPO}:${JENKINS_VERSION}-centos"]
platforms = ["linux/amd64", "linux/ppc64le", "linux/arm64"]
}

target "debian_jdk8" {
dockerfile = "8/debian/buster/hotspot/Dockerfile"
context = "."
args = {
JENKINS_VERSION = JENKINS_VERSION
JENKINS_SHA = JENKINS_SHA
}
tags = ["${REGISTRY}/${JENKINS_REPO}:${JENKINS_VERSION}"]
platforms = ["linux/amd64", "linux/ppc64le", "linux/arm64"]
}

target "debian_jdk11" {
dockerfile = "11/debian/buster/hotspot/Dockerfile"
context = "."
args = {
JENKINS_VERSION = JENKINS_VERSION
JENKINS_SHA = JENKINS_SHA
}
tags = ["${REGISTRY}/${JENKINS_REPO}:${JENKINS_VERSION}-jdk11"]
platforms = ["linux/amd64", "linux/ppc64le", "linux/arm64", "linux/s390x"]
}

target "debian_slim_jdk8" {
dockerfile = "8/debian/buster-slim/hotspot/Dockerfile"
context = "."
args = {
JENKINS_VERSION = JENKINS_VERSION
JENKINS_SHA = JENKINS_SHA
}
tags = ["${REGISTRY}/${JENKINS_REPO}:${JENKINS_VERSION}-slim"]
platforms = ["linux/amd64", "linux/ppc64le", "linux/arm64"]
}

target "windows_1809_jdk11" {
dockerfile = "11/windows/windowsservercore-1809/hotspot/Dockerfile"
context = "."
args = {
JENKINS_VERSION = JENKINS_VERSION
JENKINS_SHA = JENKINS_SHA
}

tags = ["{REGISTRY}/${JENKINS_REPO}:jdk11-hotspot-windowsservercore-1809"]
}

target "windows_2019_jdk11" {
dockerfile = "11/windows/windowsservercore-2019/hotspot/Dockerfile"
context = "."
args = {
JENKINS_VERSION = JENKINS_VERSION
JENKINS_SHA = JENKINS_SHA
}
tags = ["{REGISTRY}/${JENKINS_REPO}:jdk11-hotspot-windowsservercore-2019"]
}

0 comments on commit 12fb253

Please sign in to comment.