Flashing pixhawk from inside a docker container

I built the pixhawk4 firmware with make px4_fmu-v5_rtps inside a docker container.
Now I want to upload that firmware to it with make px4_fmu-v5_rtps upload but it just waits for the bootloader without anything actually happening.

This is the docker run command I used:

docker run \
  -it \
  --privileged \
  --device /dev/ttyACM0 \
  --device /dev/ttyACM1 \
  --device /dev/ttyUSB0 \
  --device /dev/ttyUSB1 \
  --device /dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v5.x_0-if00 \
  --device /dev/serial/by-id/usb-FTDI_TTL232R_FTA6E618-if00-port0 \
  -v /dev:/dev \
  image_name

At first I thought the devices are just not available but I can connect to the nsh with “screen” on /dev/ttyUSB1.

I also noticed that if I run QGroundControl inside the docker container it doesn’t find the pixhawk.

It would already help me if someone could tell me where I can find the script that controls the flashing so I can look into it and find out what might be missing.

This might help:

Thank you for your reply but I am already using the --device option. Or did you mean something else ?