IntelliJ:使用docker jvm或docker maven? [英] IntelliJ: use docker jvm or docker maven?

查看:201
本文介绍了IntelliJ:使用docker jvm或docker maven?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个docker / jvm实例,我从命令行使用编译和运行java代码。 IntelliJ的项目配置要求我指向文件系统上的jvm。



所以,我想知道,我可以配置intellij来使用这个docker容器吗?我想我可以配置一个docker容器,保持运行,并挂载/共享其文件系统,但我不想要 - 我想使用我的短暂容器实例。



我有同样的想法,使用maven - 我可以使用maven的docker实例,而不需要安装文件系统,从intellij?再次,intellij似乎需要一个指向maven的文件系统位置的指针,所以这似乎是有问题的。



有没有人有任何线索,如果这是可能的,或如何去配置这样的东西?

解决方案


同样,intellij似乎需要一个指向文件系统位置的指针maven,所以这似乎是有问题的。


应用程序使用另一个集装箱化的唯一方法是因为该应用程序本身位于同一容器中(或从另一个容器装载数据卷,避免了本地文件系统的安装)。



所以使用类似 dlsniper / docker-intellij / (用于去,但容易适应于java)将工作,并允许IntelliJ 容器




  • 共享X11插座为了看到conta

  • 使用数据卷(再次,不直接安装本地文件系统):


    • 数据量为jvm

    • 数据量为java源



I have a docker/jvm instance, which I use from the command line to compile and run java code. IntelliJ's project config requires me to point at a jvm on the filesystem.

So, I was wondering, can I configure intellij to use this docker container? I suppose I could configure a docker container, keep it running, and mount/share its filesystem, but I don't want that -- I want to use my ephemeral container instance.

I have the same idea for using maven -- can I use a docker instance of maven without mounting the filesystem, from within intellij? Again, intellij seems to require a pointer to a filesystem location for maven, so this seems problematic.

Does anyone have any clue if this is possible, or how to go about configuring such a thing?

解决方案

Again, intellij seems to require a pointer to a filesystem location for maven, so this seems problematic.

The only way for an application to use another containerized one would be for that application itself to be in the same container (or to mount a data volume from another container, which avoids mounting the local filesystem)

So using something like dlsniper/docker-intellij/ (used for go, but easily adapted for java) would work, and allow an IntelliJ container to

  • share the X11 socket in order to see the containerized application on the host desktop,
  • uses data volumes (again, without mounting a local filesystem directly):
    • data-volume for the jvm
    • data-volume for the java sources

这篇关于IntelliJ:使用docker jvm或docker maven?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆