Skip to content

Base Image for 21.0.4-ms by @wezell #6

Base Image for 21.0.4-ms by @wezell

Base Image for 21.0.4-ms by @wezell #6

name: Build SDKMan Base Java Image
run-name: Base Image for ${{ inputs.sdkman_java_version }} by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
sdkman_java_version:
description: 'SDKMAN version string run "sdk list java" for options'
required: true
multi_arch:
description: 'Multi-arch flag, true: linux/amd64,linux/arm64 or false: linux/amd64'
type: boolean
required: false
default: true
push:
description: 'Push flag'
type: boolean
required: false
default: true
jobs:
build_image:
name: Build Docker Base Image
runs-on: ubuntu-20.04
steps:
- name: Checkout core
uses: actions/checkout@v4
- name: Set Common Vars
run: |
PLATFORMS='linux/amd64'
[[ "${{ github.event.inputs.multi_arch }}" == 'true' ]] && PLATFORMS='linux/amd64,linux/arm64'
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/[email protected]
with:
platforms: amd64,arm64
if: github.event.inputs.multi_arch == 'true'
- id: docker-setup-buildx
name: Docker Setup Buildx
uses: docker/[email protected]
with:
platforms: ${{ env.PLATFORMS }}
driver-opts: |
image=moby/buildkit:v0.12.2
if: github.event.inputs.multi_arch == 'true'
- name: Docker Hub login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/[email protected]
with:
context: ./docker/java-base
push: ${{ github.event.inputs.push }}
tags: dotcms/java-base:${{ github.event.inputs.sdkman_java_version }}
platforms: ${{ env.PLATFORMS }}
build-args:
SDKMAN_JAVA_VERSION=${{ github.event.inputs.sdkman_java_version }}