linux – Is it possible to run commands that exist only on the host on a docker container?

No, it’s not possible.

For example, if my Ubuntu host have vim installed and I create an Ubuntu container without vim, I cannot run it inside the container. And that hinders me sometimes when I need to debug something.

So you need 2 sets of profiles: debug and production. Debug, as your developers want, will have all the tools they need to debug, test, inspect, and break things. The production profile will only have the bare minimum.

There are two main risks with this approach. The first is deploying the development image to production, and that can open doors to a whole world of pain. The second is building code that works on development but not on production, because some component is mistakenly left off.