Skip to content

Commit

Permalink
Allow building of k0s images via earthly (#3142)
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Morales <[email protected]>
  • Loading branch information
mauromorales authored Jan 27, 2025
1 parent 45b5684 commit 97872af
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
5 changes: 3 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG TRIVY_VERSION=0.57.1
# renovate: datasource=docker depName=anchore/grype versioning=semver
ARG GRYPE_VERSION=v0.85.0
# renovate: datasource=docker depName=quay.io/kairos/framework versioning=semver
ARG KAIROS_FRAMEWORK_VERSION=v2.15.4
ARG KAIROS_FRAMEWORK_VERSION=v2.15.10
# renovate: datasource=docker depName=quay.io/kairos/auroraboot versioning=semver
ARG AURORABOOT_VERSION=v0.4.3
# renovate: datasource=docker depName=golang versioning=semver
Expand Down Expand Up @@ -253,6 +253,7 @@ base-image:
ARG K3S_VERSION # As it comes from luet package
ARG SOFTWARE_VERSION_PREFIX="k3s"
ARG _SOFTWARE_LUET_VERSION=$K3S_VERSION
ARG SOFTWARE_VERSION_BUILD="k3s1"
# Takes 1.28.2+1 and converts that to v1.18.2+k3s1
# Hack because we use a different version in the luet package and in the
# artifact names.
Expand All @@ -261,7 +262,7 @@ base-image:
# luet, in the artifact names. E.g. v1.28.2+k3s2+3 (including our build number)
IF [ "$K3S_VERSION" != "" ]
ARG _FIXED_VERSION=$(echo $K3S_VERSION | sed 's/+[[:digit:]]*//')
ARG SOFTWARE_VERSION="v${_FIXED_VERSION}+k3s1"
ARG SOFTWARE_VERSION="v${_FIXED_VERSION}+${SOFTWARE_VERSION_PREFIX}${SOFTWARE_VERSION_BUILD}"
END

COPY +git-version/GIT_VERSION GIT_VERSION
Expand Down
2 changes: 1 addition & 1 deletion images/Dockerfile.kairos
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ FROM base-kairos AS kairos-standard
ARG SOFTWARE_VERSION
LABEL io.kairos.k3s_version="${SOFTWARE_VERSION}"
RUN luet install -y system/provider-kairos
RUN luet install -y "k8s/k3s-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip
RUN luet install -y "k8s/${SOFTWARE_VERSION_PREFIX}-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip

FROM kairos-${VARIANT} AS kairos-final
ARG BASE_IMAGE
Expand Down
2 changes: 1 addition & 1 deletion images/Dockerfile.kairos-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ FROM base-kairos AS kairos-standard
ARG SOFTWARE_VERSION
LABEL io.kairos.k3s_version="${SOFTWARE_VERSION}"
RUN luet install -y system/provider-kairos
RUN luet install -y "k8s/k3s-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip
RUN luet install -y "k8s/${SOFTWARE_VERSION_PREFIX}-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip

FROM kairos-${VARIANT} AS kairos-final

Check warning on line 197 in images/Dockerfile.kairos-alpine

View workflow job for this annotation

GitHub Actions / core-rpi3 / alpine-3.19

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 197 in images/Dockerfile.kairos-alpine

View workflow job for this annotation

GitHub Actions / core-rpi3 / alpine-3.19

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 197 in images/Dockerfile.kairos-alpine

View workflow job for this annotation

GitHub Actions / core-rpi4 / alpine-3.19

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 197 in images/Dockerfile.kairos-alpine

View workflow job for this annotation

GitHub Actions / core-rpi4 / alpine-3.19

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG BASE_IMAGE
Expand Down
14 changes: 10 additions & 4 deletions images/Dockerfile.kairos-debian
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
squashfs-tools \
sudo \
systemd \
systemd-cryptsetup \
systemd-resolved \
systemd-sysv \
systemd-timesyncd \
Expand All @@ -114,10 +113,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zerofree \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

###############################################################
#### bookworm vs testing differences ####
###############################################################
FROM common AS common-bookworm
FROM common AS common-testing
RUN apt-get update && apt-get install -y systemd-cryptsetup && apt-get clean && rm -rf /var/lib/apt/lists/*

###############################################################
#### Common to a Model ####
###############################################################
FROM common AS amd64-generic
FROM common-${FLAVOR_RELEASE} AS amd64-generic
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
grub2 \
Expand All @@ -129,7 +135,7 @@ RUN apt-get update \
zfsutils-linux \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

FROM common AS arm64-common
FROM common-${FLAVOR_RELEASE} AS arm64-common
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
grub-efi-arm64-bin \
Expand Down Expand Up @@ -207,7 +213,7 @@ FROM base-kairos AS kairos-standard
ARG SOFTWARE_VERSION
LABEL io.kairos.k3s_version="${SOFTWARE_VERSION}"
RUN luet install -y system/provider-kairos
RUN luet install -y "k8s/k3s-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip
RUN luet install -y "k8s/${SOFTWARE_VERSION_PREFIX}-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip

FROM kairos-${VARIANT} AS kairos-final
ARG BASE_IMAGE
Expand Down
2 changes: 1 addition & 1 deletion images/Dockerfile.kairos-opensuse
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ FROM base-kairos AS kairos-standard
ARG SOFTWARE_VERSION
LABEL io.kairos.k3s_version="${SOFTWARE_VERSION}"
RUN luet install -y system/provider-kairos
RUN luet install -y "k8s/k3s-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip
RUN luet install -y "k8s/${SOFTWARE_VERSION_PREFIX}-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip

FROM kairos-${VARIANT} AS kairos-final

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-rpi3 / opensuse-leap-15.6

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-rpi3 / opensuse-leap-15.6

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-generic / opensuse-leap-15.6

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-generic / opensuse-leap-15.6

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-rpi4 / opensuse-leap-15.6

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-rpi4 / opensuse-leap-15.6

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-rpi3 / opensuse-tumbleweed

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-rpi3 / opensuse-tumbleweed

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-rpi4 / opensuse-tumbleweed

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 207 in images/Dockerfile.kairos-opensuse

View workflow job for this annotation

GitHub Actions / core-rpi4 / opensuse-tumbleweed

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG BASE_IMAGE
Expand Down
2 changes: 1 addition & 1 deletion images/Dockerfile.kairos-rhel
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ FROM base-kairos AS kairos-standard
ARG SOFTWARE_VERSION
LABEL io.kairos.k3s_version="${SOFTWARE_VERSION}"
RUN luet install -y system/provider-kairos
RUN luet install -y "k8s/k3s-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip
RUN luet install -y "k8s/${SOFTWARE_VERSION_PREFIX}-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip

FROM kairos-${VARIANT} AS kairos-final

Check warning on line 158 in images/Dockerfile.kairos-rhel

View workflow job for this annotation

GitHub Actions / core-generic / fedora-40

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 158 in images/Dockerfile.kairos-rhel

View workflow job for this annotation

GitHub Actions / core-generic / fedora-40

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG BASE_IMAGE
Expand Down
2 changes: 1 addition & 1 deletion images/Dockerfile.kairos-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ FROM base-kairos AS kairos-standard
ARG SOFTWARE_VERSION
LABEL io.kairos.k3s_version="${SOFTWARE_VERSION}"
RUN luet install -y system/provider-kairos
RUN luet install -y "k8s/k3s-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip
RUN luet install -y "k8s/${SOFTWARE_VERSION_PREFIX}-$(which-init.sh)@${SOFTWARE_LUET_VERSION:-$SOFTWARE_VERSION}" utils/edgevpn utils/k9s utils/nerdctl container/kubectl utils/kube-vip

FROM kairos-${VARIANT} AS kairos-final

Check warning on line 424 in images/Dockerfile.kairos-ubuntu

View workflow job for this annotation

GitHub Actions / core-generic / ubuntu-24.10

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 424 in images/Dockerfile.kairos-ubuntu

View workflow job for this annotation

GitHub Actions / core-generic / ubuntu-24.10

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 424 in images/Dockerfile.kairos-ubuntu

View workflow job for this annotation

GitHub Actions / core-rpi4 / ubuntu-20.04

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 424 in images/Dockerfile.kairos-ubuntu

View workflow job for this annotation

GitHub Actions / core-rpi4 / ubuntu-20.04

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 424 in images/Dockerfile.kairos-ubuntu

View workflow job for this annotation

GitHub Actions / core-rpi4 / ubuntu-22.04

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 424 in images/Dockerfile.kairos-ubuntu

View workflow job for this annotation

GitHub Actions / core-rpi4 / ubuntu-22.04

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 424 in images/Dockerfile.kairos-ubuntu

View workflow job for this annotation

GitHub Actions / nvidia-arm-core / ubuntu-22.04

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 424 in images/Dockerfile.kairos-ubuntu

View workflow job for this annotation

GitHub Actions / nvidia-arm-core / ubuntu-22.04

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG kairos-${VARIANT} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG BASE_IMAGE
Expand Down

0 comments on commit 97872af

Please sign in to comment.