Skip to content

Commit

Permalink
Add dockerfile build support for Ubuntu16.04
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams authored Jun 16, 2021
1 parent 5e0ce42 commit ebe9420
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,44 @@ pipeline {
stages {
stage('Docker Build') {
parallel {
stage('Linux x64') {
stage('CentOS7 x64') {
agent {
label "dockerBuild&&linux&&x64"
}
steps {
dockerBuild('amd64')
dockerBuild('amd64', 'centos7', 'Dockerfile.CentOS7')
}
}
stage('Linux aarch64') {
stage('Ubuntu16.04 x64') {
agent {
label "dockerBuild&&linux&&aarch64"
}
steps {
dockerBuild('arm64')
dockerBuild('x64', 'ubuntu1604', 'Dockerfile.Ubuntu1604')
}
}
stage('Linux ppc64le') {
stage('CentOS7 aarch64') {
agent {
label "dockerBuild&&linux&&aarch64"
}
steps {
dockerBuild('arm64', 'centos7', 'Dockerfile.CentOS7')
}
}
stage('Ubuntu16.04 aarch64') {
agent {
label "dockerBuild&&linux&&aarch64"
}
steps {
dockerBuild('arm64', 'ubuntu1604', 'Dockerfile.Ubuntu1604')
}
}
stage('CentOS7 ppc64le') {
agent {
label "dockerBuild&&linux&&ppc64le"
}
steps {
dockerBuild('ppc64le')
dockerBuild('ppc64le', 'centos7', 'Dockerfile.CentOS7')
}
}
}
Expand All @@ -43,12 +59,12 @@ pipeline {
}
}

def dockerBuild(architecture) {
def dockerBuild(architecture, distro, dockerfile) {
git poll: false, url: 'https://github.com/adoptium/infrastructure.git'
sh label: '', script: "docker build -t adoptopenjdk/centos7_build_image:linux-$architecture -f ansible/Dockerfile.CentOS7 ."
sh label: '', script: "docker build -t adoptopenjdk/$distro_build_image:linux-$architecture -f ansible/docker/$dockerfile ."
// dockerhub is the ID of the credentials stored in Jenkins
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') {
sh label: '', script: "docker push adoptopenjdk/centos7_build_image:linux-$architecture"
sh label: '', script: "docker push adoptopenjdk/$distro_build_image:linux-$architecture"
}
}

Expand All @@ -57,6 +73,7 @@ def dockerManifest() {
docker.withRegistry('https://index.docker.io/v1/', 'dockerhub') {
git poll: false, url: 'https://github.com/adoptium/infrastructure.git'
sh '''
# Centos7
export TARGET="adoptopenjdk/centos7_build_image"
AMD64=$TARGET:linux-amd64
ARM64=$TARGET:linux-arm64
Expand All @@ -66,6 +83,14 @@ def dockerManifest() {
docker manifest annotate $TARGET $ARM64 --arch arm64 --os linux
docker manifest annotate $TARGET $PPC64LE --arch ppc64le --os linux
docker manifest push $TARGET
# Ubuntu1604
export TARGET="adoptopenjdk/ubuntu1604_build_image"
AMD64=$TARGET:linux-amd64
ARM64=$TARGET:linux-arm64
docker manifest create $TARGET $AMD64 $ARM64 $PPC64LE
docker manifest annotate $TARGET $AMD64 --arch amd64 --os linux
docker manifest annotate $TARGET $ARM64 --arch arm64 --os linux
docker manifest push $TARGET
'''
}
}

0 comments on commit ebe9420

Please sign in to comment.