0

Hi I'm new to linux(ubuntu) and docker. I would like to use docker to set development environment for each project. e.g. Project1 use vscode + python(version1) + some pip modules and Project2 use Pycharm + python(version2) + some pip modules.

Then, does host OS need no IDE(vscode, pycharm), programming language(e.g. python(3.xx.x, 3.yy.y)? Because a docker image has project's environment even IDE and language.

  • If I were you, I would not learn Linux and Docker from scratch, at the same time, with the most complex possible set up. If installing an IDE the good old way feels like a burden to you, you're going to get utterly frustrated trying to either run GUI apps from containers or doing all your coding in vi. – Álvaro González Jun 06 '23 at 10:43

1 Answers1

1

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.

David Maze
  • 130,717
  • 29
  • 175
  • 215