search

Home  >  Q&A  >  body text

Can the development environment built by docker really allow novice programmers who don't know how to build an environment to quickly start writing code?

I just started learning about docker because I started a new project using Django+Hbase+Git. It would take a long time just to build an ordinary development environment, so I studied docker, but I am not familiar with building docker. The development environment is still somewhat unclear.

The idea of ​​our project team is that as long as everyone has docker installed on their host, they can use Pycharm directly in docker to develop, modify the code and synchronize through Git. The ideal situation is that other developers can even use Pycharm. There is no need to install . The worst case is that developers only need to install python, Pycharm, and docker, and then they can perform ordinary debugging and running of the code in local Pycharm. I don’t know if docker can achieve such a function. Please ask. Great advice lol

过去多啦不再A梦过去多啦不再A梦2747 days ago787

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 13:19:27

    First of all, you cannot run pycharm in docker. You must treat each container of docker as an independent computer. I would like to ask, if someone else has pycharm installed on their computer and you are on the same LAN, can you use his pycharm to edit the python code on your computer?

    Docker mainly handles environment isolation and packaging

    Environment isolation: Each Docker container can be simply understood as a sandbox. Various software installed in the container will not affect the real software environment of the host. Assume a scenario where you have 10 projects that are being maintained at the same time, but the problem is that these 10 projects each depend on different python versions (project 1 depends on python1.1, project 2 depends on python1.2, and project 3 depends on python2 .1...Project 10 depends on python3.3), what should you do if you don’t use docker? Install one version of each on your computer? Will there be any conflicts in environmental dependencies between versions? Doesn’t it make your head hurt just thinking about it? Docker is completely ok. Their respective environments are completely independent and do not affect each other. You can play whatever you want

    Environment packaging: Suppose you have a development team of 100 people. Some development environments are windows, some are linux (the specific versions vary), and some are mac. There are a wide variety of software versions installed on the respective systems. At this time, you want to develop a project. Since it is a project, it must be the best to unify the development environment, consistent various configuration parameters, consistent python version, consistent various expansion packs and expansion pack versions, consistent Environment variables, etc. At this time, if you let each configure their own environment, it may be done by three times, five, and two by two for veterans, but for newcomers who are not very experienced, it may take several days to complete this environment. . Docker is simple. As long as one person writes a dockerfile file, writes various configurations in it, and then distributes it to all development team members, everyone only needs a docker build command to complete the environment construction and the system in which the software runs. The environment, configuration parameters, extension libraries and dependencies are all the same. After the project is completed and actually goes online, you can also use this dockerfile to build an online software project running environment with one click (or directly package the containers used in local development into images and then publish the images), and ensure the online running environment. It is consistent with the local development environment and avoids various problems caused by different environments.

    As far as your question is concerned, combined with my personal experience, Django and Hbase can be placed in docker (the Django image should come with its own python operating environment), and pycharm and git are installed on the host machine. So what developers need to install is pycharm+git+docker

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 13:19:27

    Can docker run pycharm? Besides, it is just a python environment, and third-party references are also easy to control.
    Docker is more useful in operation and maintenance. It can be deployed and used without setting up a running environment for the program. After the development is completed and packaged for release, do you want to develop the machine using docker? That's very courageous.

    reply
    0
  • Cancelreply