diff --git a/.github/flavors-arm.json b/.github/flavors-arm.json index 210ee0eb8..9801546d1 100644 --- a/.github/flavors-arm.json +++ b/.github/flavors-arm.json @@ -1,43 +1,43 @@ [ { - "flavor": "opensuse-leap-arm-rpi", + "flavor": "opensuse-leap", "model": "rpi4", "worker": "ubuntu-latest", "standard": "true" }, { - "flavor": "opensuse-tumbleweed-arm-rpi", + "flavor": "opensuse-tumbleweed", "model": "rpi4", "worker": "ubuntu-latest", "standard": "true" }, { - "flavor": "alpine-arm-rpi", + "flavor": "alpine", "model": "rpi4", "worker": "ubuntu-latest", "standard": "true" }, { - "flavor": "ubuntu-arm-rpi", + "flavor": "ubuntu", "model": "rpi4", "worker": "ubuntu-latest", "standard": "true" }, { - "flavor": "ubuntu-20-lts-arm-rpi", + "flavor": "ubuntu-20-lts", "model": "rpi4", "worker": "ubuntu-latest", "standard": "true" }, { - "flavor": "ubuntu-22-lts-arm-rpi", + "flavor": "ubuntu-22-lts", "model": "rpi4", "worker": "ubuntu-latest", "standard": "true" }, { - "flavor": "ubuntu-20-lts-arm-nvidia-jetson-agx-orin", - "model": "none", + "flavor": "ubuntu-20-lts", + "model": "jetson-agx-orin", "worker": "fast" } ] diff --git a/.github/flavors.json b/.github/flavors.json index f13237b3b..56ddc9198 100644 --- a/.github/flavors.json +++ b/.github/flavors.json @@ -45,5 +45,46 @@ }, { "flavor": "almalinux" + }, + { + "flavor": "opensuse-leap", + "model": "rpi4", + "worker": "ubuntu-latest", + "standard": "true" + }, + { + "flavor": "opensuse-tumbleweed", + "model": "rpi4", + "worker": "ubuntu-latest", + "standard": "true" + }, + { + "flavor": "alpine", + "model": "rpi4", + "worker": "ubuntu-latest", + "standard": "true" + }, + { + "flavor": "ubuntu", + "model": "rpi4", + "worker": "ubuntu-latest", + "standard": "true" + }, + { + "flavor": "ubuntu-20-lts", + "model": "rpi4", + "worker": "ubuntu-latest", + "standard": "true" + }, + { + "flavor": "ubuntu-22-lts", + "model": "rpi4", + "worker": "ubuntu-latest", + "standard": "true" + }, + { + "flavor": "ubuntu-20-lts", + "model": "jetson-agx-orin", + "worker": "fast" } ] diff --git a/Earthfile b/Earthfile index b22b8c808..b67f905ce 100644 --- a/Earthfile +++ b/Earthfile @@ -314,25 +314,48 @@ base-image: ARG HWE IF [ "$BASE_IMAGE" = "" ] - # DISTRO is used to match the Linux distribution in the Dockerfile e.g. Dockerfile.ubuntu - # This is a bit messy at the moment, but it will be sorted out when we stop including the model and the arch in - # the flavor name e.g. ubuntu-20-lts-arm-rpi - IF [[ "$FLAVOR" =~ ^alpine* ]] # TODO: only needed while we don't have a pure alpine - ARG DISTRO=alpine - ELSE IF [[ "$FLAVOR" = "ubuntu-20-lts-arm-nvidia-jetson-agx-orin" ]] # TODO: needs to still be merged on Dockerfile.ubuntu (or not?) - ARG DISTRO=ubuntu-20-lts-arm-nvidia-jetson-agx-orin - ELSE IF [[ "$FLAVOR" =~ "ubuntu" ]] # TODO: need to find a better way to match the flavor and the distro in the dockerfile for Ubuntu - ARG DISTRO=ubuntu - ELSE - ARG DISTRO=$(echo $FLAVOR | sed 's/-arm-.*//') + IF [ "$FLAVOR" = "ubuntu-20-lts-arm-nvidia-jetson-agx-orin" ] + ARG UPSTREAM_IMAGE=ubuntu:20.04 + ARG DISTRO=ubuntu + ELSE IF [ "$FLAVOR" =~ ^ubuntu-20-lts* ] + ARG UPSTREAM_IMAGE=ubuntu:20.04 + ARG DISTRO=ubuntu + ELSE IF [ "$FLAVOR" =~ ^ubuntu-22-lts* ] + ARG UPSTREAM_IMAGE=ubuntu:22.04 + ARG DISTRO=ubuntu + ELSE IF [ "$FLAVOR" =~ ^ubuntu* ] + ARG UPSTREAM_IMAGE=ubuntu:rolling + ARG DISTRO=ubuntu + ELSE IF [ "$FLAVOR" = "opensuse-leap" ] + ARG UPSTREAM_IMAGE=opensuse/leap:15.5 + ARG DISTRO=opensuse + ELSE IF [ "$FLAVOR" = "opensuse-tumbleweed" ] + ARG UPSTREAM_IMAGE=opensuse/tumbleweed + ARG DISTRO=opensuse + ELSE IF [ "$FLAVOR" = "alpine-ubuntu" ] + ARG UPSTREAM_IMAGE=alpine + ARG DISTRO=alpine + ELSE IF [ "$FLAVOR" = "alpine-opensuse-leap" ] + ARG UPSTREAM_IMAGE=alpine + ARG DISTRO=alpine + ELSE IF [ "$FLAVOR" = "fedora" ] + ARG UPSTREAM_IMAGE=fedora:latest + ARG DISTRO=fedora + ELSE IF [ "$FLAVOR" = "debian" ] && [ "$TARGETARCH" = "amd64" ] + ARG UPSTREAM_IMAGE=debian:testing + ARG DISTRO=debian + ELSE IF [ "$FLAVOR" = "debian" ] && [ "$TARGETARCH" = "arm64" ] + ARG UPSTREAM_IMAGE=debian:bookworm-slim + ARG DISTRO=debian + ELSE IF [ "$FLAVOR" = "rockylinux" ] + ARG UPSTREAM_IMAGE=rockylinux:9 + ARG DISTRO=rockylinux + ELSE IF [ "$FLAVOR" = "almalinux" ] + ARG UPSTREAM_IMAGE=almalinux:latest + ARG DISTRO=almalinux END - # SIMPLE_FLAVOR is used to distinguish the flavor inside the Dockerfile, where it's important to make a distinction - # between e.g. ubuntu and ubuntu-20-lts, but we don't really need to know the model and the arch since this is - # defined using MODEL and TARGETARCH. - ARG SIMPLE_FLAVOR=$(echo $FLAVOR | sed 's/-arm-.*//') - - FROM DOCKERFILE --build-arg MODEL=$MODEL --build-arg FLAVOR=$SIMPLE_FLAVOR --build-arg HWE=$HWE -f images/Dockerfile.$DISTRO images/ + FROM DOCKERFILE --build-arg BASE_IMAGE=$UPSTREAM_IMAGE --build-arg MODEL=$MODEL --build-arg FLAVOR=$FLAVOR --build-arg HWE=$HWE -f images/Dockerfile.$DISTRO images/ ELSE FROM $BASE_IMAGE END diff --git a/images/Dockerfile.alpine b/images/Dockerfile.alpine index 6238ced36..b9f29a733 100644 --- a/images/Dockerfile.alpine +++ b/images/Dockerfile.alpine @@ -2,11 +2,12 @@ #### ARGS #### ############################################################### ARG MODEL=generic +ARG BASE_IMAGE=alpine ############################################################### #### Common #### ############################################################### -FROM alpine AS common +FROM $BASE_IMAGE AS common RUN apk --no-cache add \ bash \ bash-completion \ diff --git a/images/Dockerfile.debian b/images/Dockerfile.debian index 8e17f53b3..f2af6586a 100644 --- a/images/Dockerfile.debian +++ b/images/Dockerfile.debian @@ -2,18 +2,19 @@ #### ARGS #### ############################################################### ARG MODEL=generic +ARG BASE_IMAGE=debian:testing ############################################################### #### Upstream Images #### ############################################################### # we use testing for amd64 because zfsutils-linux is not available in bookworm -FROM debian:testing AS amd64-upstream +FROM $BASE_IMAGE AS amd64-upstream RUN <> /etc/apt/sources.list.d/kairos.list EOF -FROM debian:bookworm-slim AS arm64-upstream +FROM $BASE_IMAGE AS arm64-upstream ############################################################### #### Common #### diff --git a/images/Dockerfile.opensuse-leap b/images/Dockerfile.opensuse-leap index 1f8a57f56..806750e8c 100644 --- a/images/Dockerfile.opensuse-leap +++ b/images/Dockerfile.opensuse-leap @@ -2,11 +2,12 @@ #### ARGS #### ############################################################### ARG MODEL=generic +ARG BASE_IMAGE=opensuse/leap:15.5 ############################################################### #### Common #### ############################################################### -FROM opensuse/leap:15.5 AS common +FROM $BASE_IMAGE AS common RUN zypper ar -G https://download.opensuse.org/repositories/utilities/15.4/utilities.repo && \ zypper ref diff --git a/images/Dockerfile.opensuse-tumbleweed b/images/Dockerfile.opensuse-tumbleweed index ff387aa4d..b073e4a21 100644 --- a/images/Dockerfile.opensuse-tumbleweed +++ b/images/Dockerfile.opensuse-tumbleweed @@ -2,11 +2,12 @@ #### ARGS #### ############################################################### ARG MODEL=generic +ARG BASE_IMAGE=opensuse/tumbleweed ############################################################### #### Upstream #### ############################################################### -FROM opensuse/tumbleweed AS upstream +FROM $BASE_IMAGE AS upstream ############################################################### #### Arch Config #### diff --git a/images/Dockerfile.ubuntu b/images/Dockerfile.ubuntu index 384a1a57c..482507a44 100644 --- a/images/Dockerfile.ubuntu +++ b/images/Dockerfile.ubuntu @@ -15,17 +15,19 @@ ARG MODEL=generic # the default value is empty, which means the HWE kernel WILL be installed # if you want to disable the HWE kernel, set HWE to "-non-hwe" ARG HWE="" +ARG BASE_IMAGE=ubuntu:rolling # TARGETARCH is used to determine the architecture of the image # it is already set by Docker so it doesn't need to be defined here ############################################################### #### Upstream Images #### ############################################################### -FROM ubuntu:rolling AS ubuntu-upstream +FROM ${BASE_IMAGE} AS ubuntu-upstream -FROM ubuntu:20.04 AS ubuntu-20-lts-upstream +FROM ${BASE_IMAGE} AS ubuntu-20-lts-upstream + +FROM ${BASE_IMAGE} AS ubuntu-22-lts-upstream -FROM ubuntu:22.04 AS ubuntu-22-lts-upstream ############################################################### #### Pre-Process Common to All ####