开发环境 - docker能否备份环境?
phpcn_u1582
phpcn_u1582 2017-04-25 09:02:01
0
2
756

最近在学习docker,初步理解了镜像和容器的概念,但看文档和一些使用案例还是有一些地方比较迷惑。
按照docker的介绍,是可以基于基础镜像打包的,只要你有一个dockerfile就能在另外的机器上生成一模一样的环境和依赖,那我可不可以用docker来把我现在mac上的各种开发环境和工具都打到镜像里,比如webstorm,chrome,等各种命令行的或可视化ide的工具,如果这样可以的话,那不就相当于有了一个云系统了吗,我换了一台新机子,不用在重新装各种工具和环境,也不用在乎是什么系统,只要pull 这个镜像不就行了?还是说docker只能打包那些命令行形式的依赖和应用?这一块有些困惑

phpcn_u1582
phpcn_u1582

reply all (2)
左手右手慢动作

Impossible. First of all, Docker is not a new technology, but a packaging and assembly of many old technologies. You can think of it as an enhanced version of chroot, and it relies heavily on the Linux kernel. Linux is the kernel + software package, while Docker is packaging. There is no software package file system, and the kernel is shared. Therefore, it is impossible to package various development environments on Mac into mirrors as mentioned by the questioner. Regarding packaging the GUI into the Docker image, it is theoretically possible, but in practice it is impossible because Docker only performs console display of standard input, standard output and standard error, and does not have the output method of the GUI graphical interface.

    给我你的怀抱

    You are wrong. You should make the tools you need into a mirror image.

    Then just pull it in the required environment. Then use tools such as git to manage the code (dokcer only manages development environment tools).

    As for the GUI mentioned above, there is now a way to solve it. For relevant information, you can search for docker GUI or docker x11

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!