* Testing pulling and re-tagging

* Update build_temurin

* Fix merge conflicts

* Remove echo

* Bump JDK versions in checks

Co-authored-by: joe-braley <joebraley@microsoft.com>
This commit is contained in:
Joe Braley 2022-11-15 12:48:38 -06:00 коммит произвёл GitHub
Родитель abdecf8c1e
Коммит c02525552b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
14 изменённых файлов: 86 добавлений и 35 удалений

Просмотреть файл

@ -82,6 +82,21 @@ jobs:
strategy:
matrix: ${{ parameters.jobs }}
steps:
- script: |
docker pull $(image):$(tag)
docker tag $(image):$(tag) $(distro):$(tag)
displayName: Docker pull and re-tag
condition: and(succeeded(), ne(variables.distro, 'distroless'))
- script: |
docker pull $(installer_image):$(installer_tag)
docker tag $(installer_image):$(installer_tag) $(distro):$(installer_tag)-installer
docker pull $(base_image):$(base_tag)
docker tag $(base_image):$(base_tag) $(distro):$(base_tag)-base
displayName: Docker pull and re-tag distroless
condition: and(succeeded(), eq(variables.distro, 'distroless'))
- task: Docker@2
displayName: build image
condition: and(succeeded(), ne(variables.distro, 'distroless'))
@ -90,7 +105,7 @@ jobs:
repository: internal/private/openjdk/jdk
dockerfile: docker/$(distro)/Dockerfile.$(package)-jdk
containerRegistry: "Java Engineering ACR"
arguments: --build-arg IMAGE=$(image) --build-arg TAG=$(tag) --build-arg package=$(package)
arguments: --build-arg IMAGE=$(distro) --build-arg TAG=$(tag) --build-arg package=$(package)
tags: |
$(version)-$(distro)
- task: Docker@2
@ -101,7 +116,7 @@ jobs:
repository: internal/private/openjdk/jdk
dockerfile: docker/$(distro)/Dockerfile.$(package)-jdk
containerRegistry: "Java Engineering ACR"
arguments: --build-arg INSTALLER_IMAGE=$(installer_image) --build-arg INSTALLER_TAG=$(installer_tag) --build-arg BASE_IMAGE=$(base_image) --build-arg BASE_TAG=$(base_tag) --build-arg package=$(package)
arguments: --build-arg INSTALLER_IMAGE=$(distro) --build-arg INSTALLER_TAG=$(installer_tag)-installer --build-arg BASE_IMAGE=$(distro) --build-arg BASE_TAG=$(base_tag)-base --build-arg package=$(package)
tags: |
$(version)-$(distro)
- task: Docker@2
@ -113,7 +128,6 @@ jobs:
tags: |
$(version)-$(distro)
- job: wait_for_validation
dependsOn: build_internal
displayName: wait for validation
@ -134,6 +148,21 @@ jobs:
strategy:
matrix: ${{ parameters.jobs }}
steps:
- script: |
docker pull $(image):$(tag)
docker tag $(image):$(tag) $(distro):$(tag)
displayName: Docker pull and re-tag
condition: and(succeeded(), ne(variables.distro, 'distroless'))
- script: |
docker pull $(installer_image):$(installer_tag)
docker tag $(installer_image):$(installer_tag) $(distro):$(installer_tag)-installer
docker pull $(base_image):$(base_tag)
docker tag $(base_image):$(base_tag) $(distro):$(base_tag)-base
displayName: Docker pull and re-tag distroless
condition: and(succeeded(), eq(variables.distro, 'distroless'))
- task: Docker@2
displayName: build regular image
condition: and(succeeded(), ne(variables.distro, 'distroless'))
@ -153,7 +182,7 @@ jobs:
repository: public/openjdk/jdk
dockerfile: docker/$(distro)/Dockerfile.$(package)-jdk
containerRegistry: "Java Engineering ACR"
arguments: --build-arg INSTALLER_IMAGE=$(installer_image) --build-arg INSTALLER_TAG=$(installer_tag) --build-arg BASE_IMAGE=$(base_image) --build-arg BASE_TAG=$(base_tag) --build-arg package=$(package)
arguments: --build-arg INSTALLER_IMAGE=$(distro) --build-arg INSTALLER_TAG=$(installer_tag)-installer --build-arg BASE_IMAGE=$(distro) --build-arg BASE_TAG=$(base_tag)-base --build-arg package=$(package)
tags: |
$(version)-$(distro)
- task: Docker@2

24
.github/workflows/build-images.yml поставляемый
Просмотреть файл

@ -15,11 +15,33 @@ jobs:
strategy:
matrix:
baseimage: ["mariner", "distroless"]
include:
- baseimage: "mariner"
tag: "'2.0'"
- baseimage: "distroless"
base_tag: "2.0"
installer_tag: "2.0"
steps:
- uses: actions/checkout@v3
# Note: Using secrets will not work with forked pull requests
- name: Set mariner 2.0 image
if: ${{ matrix.baseimage == 'mariner' }}
run: "echo IMAGE=${{ secrets.MARINER_REPO }} >> $GITHUB_ENV"
- name: Set distroless image
if: ${{ matrix.baseimage == 'distroless' }}
run: |
echo INSTALLER_IMAGE=${{ secrets.DISTROLESS_INSTALLER_REPO }} >> $GITHUB_ENV
echo BASE_IMAGE=${{ secrets.DISTROLESS_BASE_REPO }} >> $GITHUB_ENV
- name: Build the image
run: docker build -t mcr.microsoft.com/openjdk/jdk:8-${{ matrix.baseimage }} -f ./docker/${{ matrix.baseimage }}/Dockerfile.temurin-8-jdk ./docker/${{ matrix.baseimage }}/
if: ${{ matrix.baseimage != 'distroless' }}
run: docker build -t mcr.microsoft.com/openjdk/jdk:8-${{ matrix.baseimage }} -f ./docker/${{ matrix.baseimage }}/Dockerfile.temurin-8-jdk ./docker/${{ matrix.baseimage }}/ --build-arg IMAGE=${{ env.IMAGE }} --build-arg TAG=${{ matrix.tag }}
- name: Build the distroless image
if: ${{ matrix.baseimage == 'distroless' }}
run: docker build -t mcr.microsoft.com/openjdk/jdk:8-${{ matrix.baseimage }} -f ./docker/${{ matrix.baseimage }}/Dockerfile.temurin-8-jdk ./docker/${{ matrix.baseimage }}/ --build-arg INSTALLER_IMAGE=${{ env.INSTALLER_IMAGE }} --build-arg INSTALLER_TAG=${{ matrix.installer_tag }} --build-arg BASE_IMAGE=${{ env.BASE_IMAGE }} --build-arg BASE_TAG=${{ matrix.base_tag }}
build_msopenjdk:
runs-on: ubuntu-latest

Просмотреть файл

@ -12,7 +12,7 @@ jobs:
matrix:
distros: [ "mariner", "distroless" ]
jdkvendor: [ "temurin" ]
jdkversion: [ { major: "8", expected: "1.8.0_345" } ]
jdkversion: [ { major: "8", expected: "1.8.0_352" } ]
steps:
- uses: actions/checkout@v3
@ -27,7 +27,7 @@ jobs:
matrix:
distros: [ "mariner", "distroless", "mariner-cm1", "ubuntu" ]
jdkvendor: [ "msopenjdk" ]
jdkversion: [ { major: "11", expected: "11.0.16.1" }, { major: "17", expected: "17.0.4.1" } ]
jdkversion: [ { major: "11", expected: "11.0.17" }, { major: "17", expected: "17.0.5" } ]
steps:
- uses: actions/checkout@v3

Просмотреть файл

@ -1,7 +1,7 @@
ARG INSTALLER_IMAGE="mcr.microsoft.com/cbl-mariner/base/core"
ARG INSTALLER_TAG="2.0"
ARG BASE_IMAGE="mcr.microsoft.com/cbl-mariner/distroless/base"
ARG BASE_TAG="2.0"
ARG INSTALLER_IMAGE
ARG INSTALLER_TAG
ARG BASE_IMAGE
ARG BASE_TAG
FROM ${INSTALLER_IMAGE}:${INSTALLER_TAG} AS installer

Просмотреть файл

@ -1,7 +1,7 @@
ARG INSTALLER_IMAGE="mcr.microsoft.com/cbl-mariner/base/core"
ARG INSTALLER_TAG="2.0"
ARG BASE_IMAGE="mcr.microsoft.com/cbl-mariner/distroless/base"
ARG BASE_TAG="2.0"
ARG INSTALLER_IMAGE
ARG INSTALLER_TAG
ARG BASE_IMAGE
ARG BASE_TAG
FROM ${INSTALLER_IMAGE}:${INSTALLER_TAG} AS installer

Просмотреть файл

@ -1,7 +1,7 @@
ARG INSTALLER_IMAGE="mcr.microsoft.com/cbl-mariner/base/core"
ARG INSTALLER_TAG="2.0"
ARG BASE_IMAGE="mcr.microsoft.com/cbl-mariner/distroless/base"
ARG BASE_TAG="2.0"
ARG INSTALLER_IMAGE
ARG INSTALLER_TAG
ARG BASE_IMAGE
ARG BASE_TAG
FROM ${INSTALLER_IMAGE}:${INSTALLER_TAG} AS installer

Просмотреть файл

@ -1,5 +1,5 @@
ARG IMAGE="mcr.microsoft.com/cbl-mariner/base/core"
ARG TAG="1.0"
ARG IMAGE
ARG TAG
FROM ${IMAGE}:${TAG}
LABEL "Author"="Microsoft"

Просмотреть файл

@ -1,5 +1,5 @@
ARG IMAGE="mcr.microsoft.com/cbl-mariner/base/core"
ARG TAG="1.0"
ARG IMAGE
ARG TAG
FROM ${IMAGE}:${TAG}
LABEL "Author"="Microsoft"

Просмотреть файл

@ -1,5 +1,5 @@
ARG IMAGE="mcr.microsoft.com/cbl-mariner/base/core"
ARG TAG="2.0"
ARG IMAGE
ARG TAG
FROM ${IMAGE}:${TAG}
LABEL "Author"="Microsoft"

Просмотреть файл

@ -1,5 +1,5 @@
ARG IMAGE="mcr.microsoft.com/cbl-mariner/base/core"
ARG TAG="2.0"
ARG IMAGE
ARG TAG
FROM ${IMAGE}:${TAG}
LABEL "Author"="Microsoft"

Просмотреть файл

@ -1,5 +1,5 @@
ARG IMAGE="mcr.microsoft.com/cbl-mariner/base/core"
ARG TAG="2.0"
ARG IMAGE
ARG TAG
FROM ${IMAGE}:${TAG}
LABEL "Author"="Microsoft"

Просмотреть файл

@ -1,5 +1,5 @@
ARG IMAGE="mcr.microsoft.com/mirror/docker/library/ubuntu"
ARG UBUNTU_VERSION="20.04"
ARG IMAGE
ARG UBUNTU_VERSION
ARG JAVA_VERSION="17"
FROM ${IMAGE}:${UBUNTU_VERSION}

Просмотреть файл

@ -1,5 +1,5 @@
ARG IMAGE="mcr.microsoft.com/mirror/docker/library/ubuntu"
ARG TAG="20.04"
ARG IMAGE
ARG TAG
FROM ${IMAGE}:${TAG}
LABEL "Author"="Microsoft"

Просмотреть файл

@ -1,5 +1,5 @@
ARG IMAGE="mcr.microsoft.com/mirror/docker/library/ubuntu"
ARG TAG="20.04"
ARG IMAGE
ARG TAG
FROM ${IMAGE}:${TAG}
LABEL "Author"="Microsoft"