Skip to content

Slice definition components under 'v3-essential' are not fetched and extracted into the container image #262

@rmcnew

Description

@rmcnew

Slice definition components under 'v3-essential' are not being fetched and extracted into the container image.

Consider the following Dockerfile:

ARG UBUNTU_RELEASE=24.04
ARG CHISEL_VERSION=v1.3.0

FROM ubuntu:$UBUNTU_RELEASE AS builder
ARG TARGETARCH UBUNTU_RELEASE CHISEL_VERSION
SHELL ["/bin/bash", "-oeux", "pipefail", "-c"]

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

ADD "https://github.com/canonical/chisel/releases/download/${CHISEL_VERSION}/chisel_${CHISEL_VERSION}_linux_${TARGETARCH}.tar.gz" \
    chisel.tar.gz
RUN tar -xvf chisel.tar.gz -C /usr/bin/

RUN mkdir /staging-rootfs \
     && chisel cut --release "ubuntu-$UBUNTU_RELEASE" --root /staging-rootfs \
        base-files_base \
        base-files_release-info \
        base-files_chisel \
        ca-certificates_data \
        gcc_gcc \
        binutils_archiver \
        binutils_linker \
        binutils_assembler \
        bash_bins \
        coreutils_directory-listing

RUN cp /etc/passwd /etc/group /staging-rootfs/etc \
    && install -o ubuntu -g ubuntu -d /staging-rootfs/home/ubuntu

FROM scratch
COPY --from=builder /staging-rootfs /
USER ubuntu
WORKDIR /home/ubuntu

ENTRYPOINT ["bash"]

Per the current slice definitions in https://github.com/canonical/chisel-releases/tree/ubuntu-24.04/slices, the gcc_gcc slice should include the gcc-13_gcc-13 slice.

The gcc-13_gcc-13 slice should include gcc-13-x86-64-linux-gnu_gcc-13 slice when built on amd64. But notice this is under 'v3-essential'.

The gcc-13-x86-64-linux-gnu_gcc-13 slice should include the file /usr/bin/x86_64-linux-gnu-gcc-13.

However, when the Dockerfile is built and the container image contents are examined, the expected /usr/bin/x86_64-linux-gnu-gcc-13 file is not present:

ubuntu@353deab630d1:/usr/bin$ ls -lah
total 1.9M
drwxr-xr-x 2 root root 4.0K Dec 19 19:56 .
drwxr-xr-x 7 root root 4.0K Dec 19 19:56 ..
lrwxrwxrwx 1 root root   19 Dec 19 19:56 ar -> x86_64-linux-gnu-ar
lrwxrwxrwx 1 root root   19 Dec 19 19:56 as -> x86_64-linux-gnu-as
-rwxr-xr-x 1 root root 1.4M Dec 19 19:56 bash
-rwxr-xr-x 1 root root 6.9K Dec 19 19:56 bashbug
-rwxr-xr-x 1 root root  15K Dec 19 19:56 clear_console
-rwxr-xr-x 1 root root 139K Dec 19 19:56 dir
-rwxr-xr-x 1 root root  47K Dec 19 19:56 dircolors
lrwxrwxrwx 1 root root    6 Dec 19 19:56 gcc -> gcc-13
lrwxrwxrwx 1 root root   23 Dec 19 19:56 gcc-13 -> x86_64-linux-gnu-gcc-13
lrwxrwxrwx 1 root root   19 Dec 19 19:56 ld -> x86_64-linux-gnu-ld
lrwxrwxrwx 1 root root   23 Dec 19 19:56 ld.bfd -> x86_64-linux-gnu-ld.bfd
-rwxr-xr-x 1 root root 139K Dec 19 19:56 ls
lrwxrwxrwx 1 root root    4 Dec 19 19:56 rbash -> bash
-rwxr-xr-x 1 root root 139K Dec 19 19:56 vdir

If we build the Dockerfile with podman (which seems to have better console logging) we can also see that the gcc-13-x86-64-linux-gnu_gcc-13 slice is not fetched:

[1/2] STEP 7/8: RUN mkdir /staging-rootfs      && chisel cut --release "ubuntu-$UBUNTU_RELEASE" --root /staging-rootfs         base-files_base         base-files_release-info         base-files_chisel         ca-certificates_data         gcc_gcc         binutils_archiver         binutils_linker         binutils_assembler         bash_bins         coreutils_directory-listing
2025/12/19 20:16:43 Consulting release repository...
2025/12/19 20:16:43 Fetching current ubuntu-24.04 release...
2025/12/19 20:16:43 Processing ubuntu-24.04 release...
2025/12/19 20:16:49 Selecting slices...
2025/12/19 20:16:49 Fetching ubuntu 24.04 noble suite details...
2025/12/19 20:16:51 Release date: Thu, 25 Apr 2024 15:10:33 UTC
2025/12/19 20:16:51 Fetching index for ubuntu 24.04 noble main component...
2025/12/19 20:16:51 Fetching index for ubuntu 24.04 noble universe component...
2025/12/19 20:16:53 Fetching ubuntu 24.04 noble-security suite details...
2025/12/19 20:16:53 Release date: Fri, 19 Dec 2025 18:42:50 UTC
2025/12/19 20:16:53 Fetching index for ubuntu 24.04 noble-security main component...
2025/12/19 20:16:53 Fetching index for ubuntu 24.04 noble-security universe component...
2025/12/19 20:16:54 Fetching ubuntu 24.04 noble-updates suite details...
2025/12/19 20:16:54 Release date: Fri, 19 Dec 2025 18:44:19 UTC
2025/12/19 20:16:54 Fetching index for ubuntu 24.04 noble-updates main component...
2025/12/19 20:16:54 Fetching index for ubuntu 24.04 noble-updates universe component...
2025/12/19 20:16:55 Archive "ubuntu-esm-apps" ignored: credentials not found
2025/12/19 20:16:55 Archive "ubuntu-esm-infra" ignored: credentials not found
2025/12/19 20:16:55 Fetching pool/main/b/base-files/base-files_13ubuntu10.3_amd64.deb...
2025/12/19 20:16:55 Fetching pool/main/n/ncurses/libtinfo6_6.4+20240113-1ubuntu2_amd64.deb...
2025/12/19 20:16:55 Fetching pool/main/g/glibc/libc6_2.39-0ubuntu8.6_amd64.deb...
2025/12/19 20:16:55 Fetching pool/main/b/bash/bash_5.2.21-2ubuntu4_amd64.deb...
2025/12/19 20:16:56 Fetching pool/main/b/binutils/binutils_2.42-4ubuntu2.8_amd64.deb...
2025/12/19 20:16:56 Fetching pool/main/c/ca-certificates/ca-certificates_20240203_all.deb...
2025/12/19 20:16:56 Fetching pool/main/o/openssl/libssl3t64_3.0.13-0ubuntu3.6_amd64.deb...
2025/12/19 20:16:56 Fetching pool/main/o/openssl/openssl_3.0.13-0ubuntu3.6_amd64.deb...
2025/12/19 20:16:57 Fetching pool/main/c/coreutils/coreutils_9.4-3ubuntu6.1_amd64.deb...
2025/12/19 20:16:57 Fetching pool/main/libs/libselinux/libselinux1_3.5-2ubuntu2.1_amd64.deb...
2025/12/19 20:16:57 Fetching pool/main/p/pcre2/libpcre2-8-0_10.42-4ubuntu2.1_amd64.deb...
2025/12/19 20:16:57 Fetching pool/main/libc/libcap2/libcap2_2.66-5ubuntu2.2_amd64.deb...
2025/12/19 20:16:57 Fetching pool/main/g/gcc-13/gcc-13-base_13.3.0-6ubuntu2~24.04_amd64.deb...
2025/12/19 20:16:58 Fetching pool/main/g/gcc-13/gcc-13_13.3.0-6ubuntu2~24.04_amd64.deb...
2025/12/19 20:16:58 Fetching pool/main/g/gcc-14/gcc-14-base_14.2.0-4ubuntu2~24.04_amd64.deb...
2025/12/19 20:16:58 Fetching pool/main/g/gcc-14/libgcc-s1_14.2.0-4ubuntu2~24.04_amd64.deb...
2025/12/19 20:16:58 Fetching pool/main/g/gcc-13/libgcc-13-dev_13.3.0-6ubuntu2~24.04_amd64.deb...
2025/12/19 20:16:59 Fetching pool/main/g/gcc-defaults/gcc_13.2.0-7ubuntu1_amd64.deb...
2025/12/19 20:16:59 Extracting files from package "base-files"...
2025/12/19 20:16:59 Extracting files from package "libtinfo6"...
2025/12/19 20:16:59 Extracting files from package "libc6"...
2025/12/19 20:16:59 Extracting files from package "bash"...
2025/12/19 20:16:59 Extracting files from package "binutils"...
2025/12/19 20:16:59 Extracting files from package "ca-certificates"...
2025/12/19 20:16:59 Extracting files from package "libssl3t64"...
2025/12/19 20:16:59 Extracting files from package "openssl"...
2025/12/19 20:16:59 Extracting files from package "coreutils"...
2025/12/19 20:16:59 Extracting files from package "libselinux1"...
2025/12/19 20:16:59 Extracting files from package "libpcre2-8-0"...
2025/12/19 20:16:59 Extracting files from package "libcap2"...
2025/12/19 20:16:59 Extracting files from package "gcc-13-base"...
2025/12/19 20:16:59 Extracting files from package "gcc-13"...
2025/12/19 20:16:59 Extracting files from package "gcc-14-base"...
2025/12/19 20:16:59 Extracting files from package "libgcc-s1"...
2025/12/19 20:16:59 Extracting files from package "libgcc-13-dev"...
2025/12/19 20:16:59 Extracting files from package "gcc"...
2025/12/19 20:16:59 Generating manifest at /var/lib/chisel/manifest.wall...

We can see that the same thing is also happening with the binutils slice, that is, no components under 'v3-essential' are being fetched.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions