Dependency problems while configuring nvidia-cuda-toolkit-gcc

Hello,

I am trying to build a Debian 11 on Docker (with cuda 11.8, nvhpc&mpi 23.7, cmake 3.18.4). For reference I have a MacBook Air M1, Sonoma 14.1.

When I try to build my Docker Container by running docker build --platform linux/amd64 -t my-debian11-image ., I get this error:

=> ERROR [ 7/10] RUN dpkg -i /tmp/nvidia-cuda-toolkit-gcc_11.8.0-5~deb12u1_amd64.deb                                                                              0.5s
------                                                                                                                                                                  
 > [ 7/10] RUN dpkg -i /tmp/nvidia-cuda-toolkit-gcc_11.8.0-5~deb12u1_amd64.deb:                                                                                         
0.322 Selecting previously unselected package nvidia-cuda-toolkit-gcc.
0.354 (Reading database ... 35479 files and directories currently installed.)
0.355 Preparing to unpack .../nvidia-cuda-toolkit-gcc_11.8.0-5~deb12u1_amd64.deb ...
0.362 Unpacking nvidia-cuda-toolkit-gcc (11.8.0-5~deb12u1) ...
0.439 dpkg: dependency problems prevent configuration of nvidia-cuda-toolkit-gcc:
0.439  nvidia-cuda-toolkit-gcc depends on g++-11; however:
0.439   Package g++-11 is not installed.
0.439  nvidia-cuda-toolkit-gcc depends on nvidia-cuda-toolkit (= 11.8.89~11.8.0-5~deb12u1); however:
0.439   Package nvidia-cuda-toolkit is not installed.
0.439 
0.439 dpkg: error processing package nvidia-cuda-toolkit-gcc (--install):
0.439  dependency problems - leaving unconfigured
0.448 Errors were encountered while processing:
0.448  nvidia-cuda-toolkit-gcc
------
Dockerfile:23
--------------------
  21 |     
  22 |     # Install nvidia-cuda-toolkit-gcc
  23 | >>> RUN dpkg -i /tmp/nvidia-cuda-toolkit-gcc_11.8.0-5~deb12u1_amd64.deb
  24 |     
  25 |     # Install NVHPC
--------------------
ERROR: failed to solve: process "/bin/sh -c dpkg -i /tmp/nvidia-cuda-toolkit-gcc_11.8.0-5~deb12u1_amd64.deb" did not complete successfully: exit code: 1
(base) irenebernardi@Irenes-MacBook-Air pdf_folder % gcc --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin23.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I am confused because my dockerfile (below) should successfully install the g+±11 Package.
Dockerfile:

# syntax=docker/dockerfile:1

FROM debian:bullseye

# Install essential utilities, including wget and g++
RUN apt-get update && apt-get install -y wget g++-11 && rm -rf /var/lib/apt/lists/*


# Install CUDA repository keyring
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/debian11/x86_64/cuda-keyring_1.1-1_all.deb \
    && dpkg -i cuda-keyring_1.1-1_all.deb

# Add contrib repository for CUDA Toolkit
RUN echo "deb http://deb.debian.org/debian bullseye contrib" >> /etc/apt/sources.list

# Install g++-11 and CUDA Toolkit
RUN apt-get update --fix-missing && apt-get -y install g++-11 cuda-toolkit-12-3

# Copy the local .deb file into the Docker image
COPY nvidia-cuda-toolkit-gcc_11.8.0-5~deb12u1_amd64.deb /tmp/

# Install nvidia-cuda-toolkit-gcc
RUN dpkg -i /tmp/nvidia-cuda-toolkit-gcc_11.8.0-5~deb12u1_amd64.deb

# Install NVHPC
RUN wget https://developer.download.nvidia.com/hpc-sdk/23.7/nvhpc-23-7-linux-x64.tar.gz \
    && tar -xzf nvhpc-23-7-linux-x64.tar.gz \
    && cd nvhpc-23-7-linux-x64 \
    && ./install

# Install CMake
RUN apt-get update && apt-get install -y cmake

# Set the working directory
WORKDIR /app

I appreciate any idea or guidance!
Thanks :)