Welcome to the forum @TiTan
has discussion, and then notes:
You can do this with the Linuxserver.io version of the docker. Just pass in DOCKER_MODS=linuxserver/mods:code-server-docker and it will install the binaries. Also, like you already said, don’t forget to mount the docker socket.
I went to track this down, starting at their web site:
https://github.com/linuxserver/docker-mods
click CODE-SERVER then DOCKER
https://github.com/linuxserver/docker-mods/tree/universal-docker
which surprised me until I located this:
https://github.com/linuxserver/docker-mods/tree/code-server-docker
saying it’s deprecated so use linuxserver/mods:universal-docker
I don’t use Docker, but this seems like a facility to get what you want.