I'm having a similar issue:
nixpacks.toml:
[phases.setup]
nixPkgs = ['...', 'libreoffice']
aptPkgs = ['...', 'gcc', 'g++','libstdc++6','fontconfig']
0.341 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/xpxln7rqi3pq4m0xpnawhxb2gs0mn1s0-gcc-12.3.0-lib/lib/libstdc++.so.6)
ERROR: failed to solve: process "/bin/bash -ol pipefail -c apt-get update && apt-get install -y --no-install-recommends gcc g++ libstdc++6 fontconfig" did not complete successfully: exit code: 1
Error: Docker build failed
0.341 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/xpxln7rqi3pq4m0xpnawhxb2gs0mn1s0-gcc-12.3.0-lib/lib/libstdc++.so.6)