How do I continue to add other commands to the shell after remotely running the bash shell in the container using the docker exec command?

  docker, question

At present, many docker ui can remotely call docker’s rest interface to operate the container. exec can be used to execute commands inside the running container. Suppose my calls exec interface are as follows:
POST hostid:port/containers/{id}/exec
Parameters are:
AttachStderr: true
AttachStdin: true
AttachStdout: true
Cmd: [“bash”]
Tty: true
id: “xxxxxx”
After successfully creating an exec instance, how should you proceed to add commands, such as ls, to the bash shell?
I hope the leaders passing by will not hesitate to give me some advice ~

I don’t quite understand the connection between the command added in the container and the rpc interface.

If I want to add a command like ls, I will find this executable program from HOST, such as my /usr/lib/klibc/ls

Then copy the file to the container’s rootfs, and the copy method searches for “container and host file sharing.”