The first important technical answer is this: Docker images rarely if ever contain IDEs, and it's kind of tricky to run GUI applications in containers. So you have to install the IDE on the host.
The second important technical statement is that a container has an isolated filesystem. A core feature of Docker is that containers can't access the host filesystem, and the host can't see files in the container. This also means that, if you've hidden your entire development environment inside a container, you can't just run the Python interpreter in it; you need to use debugging tools like docker exec
to use it, and you need special IDE support to work in this environment.
Looking at what you describe, I might not install Docker at all. Both IDEs intrinsically need to be installed directly on the host. You can use a version manager such as pyenv to have both Python versions available, and then a Python virtual environment to isolate the per-application dependencies (see the Python Packaging User Guide).
If you really want to install nothing at all on the host system, there are also tools like Vagrant that can install a complete developer environment into a VM; it can also target a Docker environment. But your Ubuntu system also includes Debian's APT packaging system and a pretty broad catalog of packages, so installing things on the host isn't that complicated and it's pretty easy to clean up.