设置开发环境的最佳实践

发布于 2024-08-31 11:50:11 字数 426 浏览 3 评论 0原文

我使用 Linux 作为主要操作系统。我需要一些关于如何设置桌面和开发的建议。我主要从事 .Net 和 Drupal 工作,但有时也从事其他 Lamp 产品和 C/C++、Qt 工作。我也对移动(android..)和嵌入式开发感兴趣。

目前我在我的主操作系统上安装了所有东西,甚至我使用了一点。我使用了一点虚拟机(用于 lamp 服务器)。

我是否应该为每种开发使用单独的虚拟机(例如一个用于.Net/Mono,另一个用于C++,一个用于移动,一个仅用于数据库,一个用于xyz事物等) 将主要开发环境保留在主操作系统上,并将其他开发环境移至虚拟机中。

  • 主要操作系统应该混乱,
  • 让事情易于组织(必须)
  • 性能应该是最佳的(组件最佳性能的最佳设置)

我有兴趣知道其他人是如何做的。

I use Linux as primary OS. I need some suggestions regarding how should I set up my desktop and development. I do work on mostly .Net and Drupal, but some time on other lamp products and C/C++, Qt. I'm also interested in mobile (android..) and embedded development.

Currently I install everything on my main OS, even I use it a little. I use VMs a little (for lamp server).

Should I use separate VM for each kind of development (like one for .Net/Mono, another C++, one for mobile and one for db only, one for xyz things etc)
Keep primary development environment on main os and move others in VM.

  • main os should be messed up
  • keep things easy to organize (must)
  • performance should be optimal (optimal settings for best performance of components)

I'm interested to know how others' are doing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

如何视而不见 2024-09-07 11:50:11

VM 既有优点也有缺点。

优点:

  • 可移植性:您可以将图像移动到
    不同的服务器
  • 轻松备份(但冗长)
  • 复制(新成员加入团队)

缺点

  • 性能
  • 硬件要求
  • 备份大小(每个虚拟机 20-40 GB ...)
  • 备份映像的管理(有什么区别不明显)
  • 使所有图像保持最新
    (修补/Windows 更新)

对于您的场景,我将创建具有核心操作系统和共享组件(Web 服务器、数据库)的基础 VM,对其进行复制并将特定工具安装到单独的 VM 中。如果您在虚拟机中组合使用工具,您最终可能会遇到与使用基本操作系统相同的混乱 - 优点是更容易摆脱它;-)

There are both pros and cons with VM's.

Pros:

  • portability: you can move image to
    different server
  • easy backup (but lengthy)
  • replication (new member joins team)

Cons

  • performance
  • hardware requirements
  • size of backups (20-40 GB per VM ...)
  • management of backed up images (what is the difference is not obvious)
  • keeping all images up to date
    (patching / Windows updates)

For your scenario, I would create base VM with core OS and shared components (Web server, database), replicated it and installed specific tools into separate VM. If you combine tools within VM, you may end up with same mess as in case of using base OS - the advantage is that it is much easier to get rid of it ;-)

小清晰的声音 2024-09-07 11:50:11
  • 最佳性能!= 使用虚拟机
  • 如果您无论如何都需要使用虚拟机,那么是的:最好为每项需要的事物使用单独的虚拟机,除非您一次需要多个虚拟机
  • Optimal performance != using VMs
  • if you need to use VMs anyway, then yes: it could be better to use a separate VM for each thing that need one, unless you need more than one at once
谜兔 2024-09-07 11:50:11

现在 OCI 容器已经稳定并且得到了良好的支持,可以通过 dockerpodman 或其他类似工具是越来越流行的选择。

它们是隔离的,但是在同一个内核下,因此:

  • 它们几乎和虚拟机一样可移植,
  • 像虚拟机一样它们可以拥有自己的虚拟IP地址,因此它们可以运行从外部不可见的服务并且不占用主机上的端口,但
  • 它们不像虚拟机那样在磁盘或内存中保留任何额外空间,并且
  • 不会因任何虚拟化层而减慢速度,并且
  • 从主机安装目录很容易,不需要任何特殊支持。

通常的方法是在开发人员的正常主目录中签出并将其挂载到容器中以进行构建、测试和运行。

远程开发扩展现在也支持在容器中进行构建 Visual Studio 代码

Now that OCI containers are stable and well supported, using those through docker, podman or other similar tool is an increasingly popular option.

They are isolated, but under the same kernel, so:

  • they are almost as portable as virtual machines,
  • like virtual machines they can have their own virtual IP addresses, so they can run services not visible from the outside and without occupying port on the host, but
  • they don't reserve any extra space on disk or in memory like virtual machines and
  • they are not slowed by any virtualization layers and
  • mounting directories from the host is easy and does not require any special support.

The usual approach is to have the checkout in the developer's normal home directory and mount it into containers for building, testing and running.

Also building in containers is now supported by Remote Development extension for Visual Studio Code

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文