Permission denied on m2 mac

I have successfully created a docker container for a python environment, logged in as root user and used console interaction. However, when I run the command “apt-get install -y netcat”, it gives me all kinds of permissions denied errors, and when I change other packages, it still gives me errors. My device runs an Apple M2 chip. And I success on Intel Mac.

root@b23daa6a51e8:/# apt-get install -y netcat
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  netcat-traditional
The following NEW packages will be installed:
  netcat netcat-traditional
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 74.6 kB of archives.
After this operation, 156 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main arm64 netcat-traditional arm64 1.10-41.1 [65.5 kB]
Get:2 http://deb.debian.org/debian buster/main arm64 netcat all 1.10-41.1 [9034 B]
Fetched 74.6 kB in 1s (125 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package netcat-traditional.
(Reading database ... 6836 files and directories currently installed.)
Preparing to unpack .../netcat-traditional_1.10-41.1_arm64.deb ...
Unpacking netcat-traditional (1.10-41.1) ...
dpkg: error processing archive /var/cache/apt/archives/netcat-traditional_1.10-41.1_arm64.deb (--unpack):
 unable to create '/bin/nc.traditional.dpkg-new' (while processing './bin/nc.traditional'): Permission denied
dpkg: error while cleaning up:
 unable to remove newly-extracted version of '/bin/nc.traditional': Permission denied
Selecting previously unselected package netcat.
Preparing to unpack .../netcat_1.10-41.1_all.deb ...
Unpacking netcat (1.10-41.1) ...
dpkg: error processing archive /var/cache/apt/archives/netcat_1.10-41.1_all.deb (--unpack):
 error creating directory './usr/share/doc/netcat': Permission denied
dpkg: error while cleaning up:
 unable to remove newly-extracted version of '/usr/share/doc/netcat': Permission denied
Errors were encountered while processing:
 /var/cache/apt/archives/netcat-traditional_1.10-41.1_arm64.deb
 /var/cache/apt/archives/netcat_1.10-41.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

dockerfile

FROM python:3.11.4-slim-buster
ENTRYPOINT ["/bin/bash"]