diff --git a/.github/workflows/wkdev-sdk.yml b/.github/workflows/wkdev-sdk.yml index 281f1e3..7488de4 100644 --- a/.github/workflows/wkdev-sdk.yml +++ b/.github/workflows/wkdev-sdk.yml @@ -37,8 +37,8 @@ jobs: remove-codeql: true remove-docker-images: true - - name: Install podman - run: sudo apt-get update && sudo apt-get -y install podman fuse-overlayfs + - name: Install dependencies + run: sudo apt-get update && sudo apt-get -y install podman fuse-overlayfs qemu-user-static - name: Checkout repo uses: actions/checkout@v4 @@ -46,7 +46,7 @@ jobs: - name: Build image run: | source ./register-sdk-on-host.sh - wkdev-sdk-bakery --mode=build --verbose + wkdev-sdk-bakery --mode=build --platforms=linux/arm/v7,linux/amd64 --verbose wkdev-sdk-bakery --mode=export --verbose - name: Archive image diff --git a/images/wkdev_sdk/Containerfile b/images/wkdev_sdk/Containerfile index 5dff35e..db1701e 100644 --- a/images/wkdev_sdk/Containerfile +++ b/images/wkdev_sdk/Containerfile @@ -47,8 +47,7 @@ RUN echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/no-sandbox # Update package list, upgrade to latest version, install necessary packages for # early bootstrapping: .deb package configuration + locale generation. -RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt/lists/ \ - ${APT_UPDATE} && \ +RUN ${APT_UPDATE} && \ ${APT_INSTALL} apt-utils dialog libterm-readline-gnu-perl locales && \ ${APT_UPGRADE} && ${APT_AUTOREMOVE} @@ -64,8 +63,7 @@ RUN dpkg-reconfigure locales # Install all dependencies for WebKit/GStreamer/etc in one pass. WORKDIR /var/tmp/wkdev-packages COPY /required_system_packages/*.lst . -RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt/lists/ \ - sed -i '/deb-src/s/^# //' /etc/apt/sources.list && \ +RUN sed -i '/deb-src/s/^# //' /etc/apt/sources.list && \ ${APT_UPDATE} && \ for list in *.lst; do \ ${APT_INSTALL} $(sed -e "s/.*#.*//; /^$/d" "${list}"); \ @@ -86,8 +84,7 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/ COPY /jhbuild/jhbuildrc /etc/xdg/jhbuildrc COPY /jhbuild/webkit-sdk-deps.modules /jhbuild/webkit-sdk-deps.modules WORKDIR /jhbuild -RUN --mount=type=tmpfs,target=/root/.cache --mount=type=cache,target=/root/.cache/sccache \ - git clone https://gitlab.gnome.org/GNOME/jhbuild.git && \ +RUN git clone https://gitlab.gnome.org/GNOME/jhbuild.git && \ cd jhbuild && \ ./autogen.sh --prefix=/usr/local && \ make && \ diff --git a/images/wkdev_sdk/jhbuild/README.txt b/images/wkdev_sdk/jhbuild/README.txt index 9143924..cf39500 100644 --- a/images/wkdev_sdk/jhbuild/README.txt +++ b/images/wkdev_sdk/jhbuild/README.txt @@ -24,7 +24,7 @@ For example, if you have this: STEP 41/46: WORKDIR /jhbuild --> 2fabea45a33f - STEP 42/46: RUN --mount=type=cache,target=/var/tmp/jhbuild ... + STEP 42/46: RUN git clone https://gitlab.gnome.org/GNOME/jhbuild.git ... Then you can debug step 27 with: diff --git a/scripts/host-only/wkdev-sdk-bakery b/scripts/host-only/wkdev-sdk-bakery index b7ae6b6..04cd8ff 100755 --- a/scripts/host-only/wkdev-sdk-bakery +++ b/scripts/host-only/wkdev-sdk-bakery @@ -19,6 +19,7 @@ argsparse_use_option =verbose "Increase verbosity of this script" argsparse_use_option =name: "Name of container image" mandatory default:wkdev-sdk argsparse_use_option =mode: "Operation mode: 'build', 'deploy', or 'export'" mandatory +argsparse_use_option =platforms: "Build container for given set of platforms" mandatory default:"linux/amd64" argsparse_use_option idle-cores: "Number of CPU cores to leave idle, when building the image" type:uint default:2 argsparse_usage_description="$(cat </dev/null timer_start - run_podman_silent_unless_verbose build --jobs $(get_number_of_cores_for_build) --tag "$(get_tag_for_build)" . || _abort_ "Container image build failed" + run_podman_silent manifest rm "$(get_tag_for_build)" + run_podman_silent_unless_verbose manifest create "$(get_tag_for_build)" || _abort_ "Container image manifest creation failed" + run_podman_silent_unless_verbose build --jobs $(get_number_of_cores_for_build) --platform "${platforms}" --manifest "$(get_tag_for_build)" . || _abort_ "Container image build failed" timer_stop popd &>/dev/null } @@ -69,7 +73,8 @@ deploy_image() { local image_directory="$(get_image_directory_by_name "${container_image_name}")" pushd "${image_directory}" &>/dev/null || _abort_ "Switching to directory '${image_directory}' failed" - run_podman_silent_unless_verbose push "$(get_tag_for_build)" || _abort_ "Pushing to registry failed" + run_podman_silent_unless_verbose push "$(get_tag_for_build)" || _abort_ "Pushing image to registry failed" + run_podman_silent_unless_verbose manifest push "${container_image_name}:$(get_container_tag)" "docker://$(get_tag_for_build)" || _abort_ "Pushing manifest to registry failed" popd &>/dev/null }