update kiwi-builder to use kiwi version as build macro #129
16
_config
16
_config
@@ -81,7 +81,6 @@ BuildFlags: onlybuild:release-manifest-image
|
|||||||
BuildFlags: onlybuild:ironic-image
|
BuildFlags: onlybuild:ironic-image
|
||||||
BuildFlags: onlybuild:ironic-ipa-downloader-image
|
BuildFlags: onlybuild:ironic-ipa-downloader-image
|
||||||
BuildFlags: onlybuild:ironic-ipa-ramdisk
|
BuildFlags: onlybuild:ironic-ipa-ramdisk
|
||||||
BuildFlags: onlybuild:kiwi-builder-image
|
|
||||||
BuildFlags: onlybuild:kube-rbac-proxy
|
BuildFlags: onlybuild:kube-rbac-proxy
|
||||||
BuildFlags: onlybuild:kube-rbac-proxy-image
|
BuildFlags: onlybuild:kube-rbac-proxy-image
|
||||||
BuildFlags: onlybuild:metallb
|
BuildFlags: onlybuild:metallb
|
||||||
@@ -105,6 +104,21 @@ BuildFlags: onlybuild:release-manifest-image
|
|||||||
PublishFlags: archsync
|
PublishFlags: archsync
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if "%_repository" == "images_16.0"
|
||||||
|
Prefer: container:sles15-image
|
||||||
|
Type: docker
|
||||||
|
BuildEngine: podman
|
||||||
|
Repotype: none
|
||||||
|
Patterntype: none
|
||||||
|
BuildFlags: dockerarg:SLE_VERSION=16.0
|
||||||
|
BuildFlags: onlybuild:kiwi-builder-image
|
||||||
|
|
||||||
|
# Publish multi-arch container images only once all archs have been built
|
||||||
|
PublishFlags: archsync
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%if "%_repository" == "charts" || "%_repository" == "phantomcharts" || "%_repository" == "releasecharts"
|
%if "%_repository" == "charts" || "%_repository" == "phantomcharts" || "%_repository" == "releasecharts"
|
||||||
Type: helm
|
Type: helm
|
||||||
Repotype: helm
|
Repotype: helm
|
||||||
|
12
_meta
12
_meta
@@ -31,14 +31,20 @@
|
|||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
</repository>
|
</repository>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- for repository in ["images", "test_manifest_images"] %}
|
{%- for repository in ["images", "images_16.0", "test_manifest_images"] %}
|
||||||
<repository name="{{ repository }}">
|
<repository name="{{ repository }}">
|
||||||
{%- if release_project is defined and repository == "images" %}
|
{%- if release_project is defined and repository != "test_manifest_images" %}
|
||||||
<releasetarget project="{{ release_project }}" repository="images" trigger="manual"/>
|
<releasetarget project="{{ release_project }}" repository="images" trigger="manual"/>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
<path project="SUSE:Registry" repository="standard"/>
|
<path project="SUSE:Registry" repository="standard"/>
|
||||||
<path project="SUSE:CA" repository="SLE_15_SP6"/>
|
{%- if repository == "images_16.0" %}
|
||||||
|
<path project="SUSE:CA" repository="16.0"/>
|
||||||
|
<path project="SUSE:SLFO:Products:SLES:16.0" repository="standard"/>
|
||||||
|
<path project="SUSE:SLFO:Main:Build" repository="standard"/>
|
||||||
|
{%- else %}
|
||||||
<path project="{{ project }}" repository="standard"/>
|
<path project="{{ project }}" repository="standard"/>
|
||||||
|
<path project="SUSE:CA" repository="SLE_15_SP6"/>
|
||||||
|
{%- endif %}
|
||||||
<arch>x86_64</arch>
|
<arch>x86_64</arch>
|
||||||
<arch>aarch64</arch>
|
<arch>aarch64</arch>
|
||||||
</repository>
|
</repository>
|
||||||
|
@@ -1,18 +1,20 @@
|
|||||||
#!BuildTag: %%IMG_PREFIX%%kiwi-builder:10.1.16.1
|
#!BuildTag: %%IMG_PREFIX%%kiwi-builder:%%kiwi_version%%.0-%RELEASE%
|
||||||
#!BuildTag: %%IMG_PREFIX%%kiwi-builder:10.1.16.1-%RELEASE%
|
#!BuildTag: %%IMG_PREFIX%%kiwi-builder:%%kiwi_version%%.0
|
||||||
FROM registry.suse.com/bci/kiwi:10.1.16
|
|
||||||
MAINTAINER SUSE LLC (https://www.suse.com/)
|
ARG KIWIVERSION="10.2.12"
|
||||||
|
FROM registry.suse.com/bci/kiwi:${KIWIVERSION}
|
||||||
|
ARG KIWIVERSION
|
||||||
|
|
||||||
# Define labels according to https://en.opensuse.org/Building_derived_containers
|
# Define labels according to https://en.opensuse.org/Building_derived_containers
|
||||||
# labelprefix=com.suse.application.akri
|
# labelprefix=com.suse.application.akri
|
||||||
LABEL org.opencontainers.image.authors="SUSE LLC (https://www.suse.com/)"
|
LABEL org.opencontainers.image.authors="SUSE LLC (https://www.suse.com/)"
|
||||||
LABEL org.opencontainers.image.title="SLE Kiwi Builder Container Image"
|
LABEL org.opencontainers.image.title="SLE Kiwi Builder Container Image"
|
||||||
LABEL org.opencontainers.image.description="kiwi-builder based on the SLE Base Container Image."
|
LABEL org.opencontainers.image.description="kiwi-builder based on the SLE Base Container Image."
|
||||||
LABEL org.opencontainers.image.version="%PACKAGE_VERSION%"
|
LABEL org.opencontainers.image.version="%%kiwi_version%%"
|
||||||
LABEL org.opencontainers.image.url="https://www.suse.com/solutions/edge-computing/"
|
LABEL org.opencontainers.image.url="https://www.suse.com/solutions/edge-computing/"
|
||||||
LABEL org.opencontainers.image.created="%BUILDTIME%"
|
LABEL org.opencontainers.image.created="%BUILDTIME%"
|
||||||
LABEL org.opencontainers.image.vendor="SUSE LLC"
|
LABEL org.opencontainers.image.vendor="SUSE LLC"
|
||||||
LABEL org.opensuse.reference="%%IMG_REPO%%/%%IMG_PREFIX%%kiwi-builder:10.1.16.1"
|
LABEL org.opensuse.reference="%%IMG_REPO%%/%%IMG_PREFIX%%kiwi-builder:%%kiwi_version%%.0-%RELEASE%"
|
||||||
LABEL org.openbuildservice.disturl="%DISTURL%"
|
LABEL org.openbuildservice.disturl="%DISTURL%"
|
||||||
LABEL com.suse.supportlevel="%%SUPPORT_LEVEL%%"
|
LABEL com.suse.supportlevel="%%SUPPORT_LEVEL%%"
|
||||||
LABEL com.suse.eula="SUSE Combined EULA February 2024"
|
LABEL com.suse.eula="SUSE Combined EULA February 2024"
|
||||||
@@ -21,8 +23,8 @@ LABEL com.suse.image-type="application"
|
|||||||
LABEL com.suse.release-stage="released"
|
LABEL com.suse.release-stage="released"
|
||||||
# endlabelprefix
|
# endlabelprefix
|
||||||
|
|
||||||
# Configure Kiwi to use kpartx
|
# help the build service understand the need for python3-kiwi
|
||||||
RUN echo -e "mapper:\n - part_mapper: kpartx" > /etc/kiwi.yml
|
RUN zypper -n install -d -D python3-kiwi; [ "%%kiwi_version%%" = "${KIWIVERSION}" ] || { echo "expected kiwi version ${KIWIVERSION}: version mismatch"; exit 1; }
|
||||||
|
|
||||||
# Copy build script into image and make it executable
|
# Copy build script into image and make it executable
|
||||||
ADD build-image.sh /usr/bin/build-image
|
ADD build-image.sh /usr/bin/build-image
|
||||||
|
@@ -8,7 +8,7 @@ Please ensure that you're running this on a registered SUSE Linux Micro 6.1 syst
|
|||||||
|
|
||||||
Next, download the podman image:
|
Next, download the podman image:
|
||||||
|
|
||||||
# podman pull %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:10.1.16.1
|
# podman pull %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:%%kiwi_version%%.0
|
||||||
|
|
||||||
Make a local output directory (where the images will reside):
|
Make a local output directory (where the images will reside):
|
||||||
|
|
||||||
@@ -16,40 +16,40 @@ Make a local output directory (where the images will reside):
|
|||||||
|
|
||||||
Then, to build a standard "Base" image, run the following in podman:
|
Then, to build a standard "Base" image, run the following in podman:
|
||||||
|
|
||||||
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:10.1.16.1 build-image
|
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:%%kiwi_version%%.0 build-image
|
||||||
|
|
||||||
To build a "Base" SelfInstall ISO, you can add additional flags, for example:
|
To build a "Base" SelfInstall ISO, you can add additional flags, for example:
|
||||||
|
|
||||||
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:10.1.16.1 build-image -p Base-SelfInstall
|
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:%%kiwi_version%%.0 build-image -p Base-SelfInstall
|
||||||
|
|
||||||
Then, to build a standard "Default" image, run the following in podman:
|
Then, to build a standard "Default" image, run the following in podman:
|
||||||
|
|
||||||
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:10.1.16.1 build-image -p Default
|
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:%%kiwi_version%%.0 build-image -p Default
|
||||||
|
|
||||||
To build a "Default" SelfInstall ISO, you can add additional flags, for example:
|
To build a "Default" SelfInstall ISO, you can add additional flags, for example:
|
||||||
|
|
||||||
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:10.1.16.1 build-image -p Default-SelfInstall
|
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:%%kiwi_version%%.0 build-image -p Default-SelfInstall
|
||||||
|
|
||||||
To build an image with a RealTime kernel, e.g. a RAW disk image ("Default"), use the following:
|
To build an image with a RealTime kernel, e.g. a RAW disk image ("Default"), use the following:
|
||||||
|
|
||||||
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:10.1.16.1 build-image -p Base-RT
|
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:%%kiwi_version%%.0 build-image -p Base-RT
|
||||||
|
|
||||||
To build an image that supports a large block/sectorsize (4096), use the "-b" flag, for example:
|
To build an image that supports a large block/sectorsize (4096), use the "-b" flag, for example:
|
||||||
|
|
||||||
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:10.1.16.1 build-image -p Default-SelfInstall -b
|
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:%%kiwi_version%%.0 build-image -p Default-SelfInstall -b
|
||||||
|
|
||||||
# mkdir mydefs/
|
# mkdir mydefs/
|
||||||
# cp /path/to/SL-Micro.kiwi mydefs/
|
# cp /path/to/SL-Micro.kiwi mydefs/
|
||||||
# cp /path/to/config.sh mydefs/
|
# cp /path/to/config.sh mydefs/
|
||||||
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -v ./mydefs/:/micro-sdk/defs/ -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:10.1.16.1 build-image
|
# podman run --privileged -v /etc/zypp/repos.d:/micro-sdk/repos/ -v ./output:/tmp/output -v ./mydefs/:/micro-sdk/defs/ -it %%IMG_REPO%%/%%IMG_PREFIXkiwi-builder:%%kiwi_version%%.0 build-image
|
||||||
|
|
||||||
All output will be in the local $(pwd)/output directory, for example:
|
All output will be in the local $(pwd)/output directory, for example:
|
||||||
|
|
||||||
# ls -1 output/
|
# ls -1 output/
|
||||||
SLE-Micro.x86_64-6.1.changes
|
SL-Micro.x86_64-6.1.changes
|
||||||
SLE-Micro.x86_64-6.1.packages
|
SL-Micro.x86_64-6.1.packages
|
||||||
SLE-Micro.x86_64-6.1.raw
|
SL-Micro.x86_64-6.1.raw
|
||||||
SLE-Micro.x86_64-6.1.verified
|
SL-Micro.x86_64-6.1.verified
|
||||||
build
|
build
|
||||||
kiwi.result
|
kiwi.result
|
||||||
kiwi.result.json
|
kiwi.result.json
|
||||||
|
@@ -16,4 +16,14 @@
|
|||||||
<param name="eval">SUPPORT_LEVEL=$(rpm --macros=/root/.rpmmacros -E %support_level)</param>
|
<param name="eval">SUPPORT_LEVEL=$(rpm --macros=/root/.rpmmacros -E %support_level)</param>
|
||||||
<param name="var">SUPPORT_LEVEL</param>
|
<param name="var">SUPPORT_LEVEL</param>
|
||||||
</service>
|
</service>
|
||||||
|
<service mode="buildtime" name="replace_using_package_version">
|
||||||
|
<param name="file">Dockerfile</param>
|
||||||
|
<param name="regex">%%kiwi_version%%</param>
|
||||||
|
<param name="package">python3-kiwi</param>
|
||||||
|
</service>
|
||||||
|
<service mode="buildtime" name="replace_using_package_version">
|
||||||
|
<param name="file">README</param>
|
||||||
|
<param name="regex">%%kiwi_version%%</param>
|
||||||
|
<param name="package">python3-kiwi</param>
|
||||||
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
Reference in New Issue
Block a user