Eclipse - Docker 集成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19655766/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse - Docker integration
提问by Pini Reznik
I'm looking for a way to integrate Docker containers with the Eclipse platform. I would like to run all build/test/debug command inside containers and use same containers in Continuous Integration build and later in production.
我正在寻找一种将 Docker 容器与 Eclipse 平台集成的方法。我想在容器内运行所有构建/测试/调试命令,并在持续集成构建和以后的生产中使用相同的容器。
The simplest way I looked on, was just to configure custom command but besides permissions problem (docker must run as sudo/root) it doesn't give me all the flexibility of real integration.
我看到的最简单的方法是配置自定义命令,但除了权限问题(docker 必须以 sudo/root 身份运行)之外,它并没有给我真正集成的所有灵活性。
Any ideas on the best way to proceed?
关于继续进行的最佳方式的任何想法?
采纳答案by Max Rydahl Andersen
it is not a full answer to your question but we (JBoss Tools team) started working on this and here are a few blogs about what is possible todo today and where we are with Eclipse docker tooling.
这不是您问题的完整答案,但我们(JBoss 工具团队)开始致力于此,这里有一些博客,介绍了今天可以做的事情以及我们在 Eclipse docker 工具方面的进展。
http://tools.jboss.org/blog/2015-03-02-getting-started-with-docker-and-wildfly.html
http://tools.jboss.org/blog/2015-03-02-getting-started-with-docker-and-wildfly.html
http://tools.jboss.org/blog/2015-03-03-docker-and-wildfly-2.html
http://tools.jboss.org/blog/2015-03-03-docker-and-wildfly-2.html
http://tools.jboss.org/blog/2015-03-30-Eclipse_Docker_Tooling.html
http://tools.jboss.org/blog/2015-03-30-Eclipse_Docker_Tooling.html
回答by bwilcox
To do that, i think you work on a Linux platform :-)
为此,我认为您在 Linux 平台上工作 :-)
What i do for a classic java project :
我为经典 Java 项目所做的工作:
- Build a Docker image that contains a jdk and maven for example
- In Eclipse, via "Run Configurations", create a "build in Docker" configuration that launch a command like this :
docker run --rm -v <eclipse_workspace_dir>:/usr/src/myapp -w /usr/src/myapp myrepo/myimage mvn clean install
- 例如构建一个包含 jdk 和 maven 的 Docker 镜像
- 在 Eclipse 中,通过“运行配置”,创建一个“在 Docker 中构建”配置,以启动如下命令:
docker run --rm -v <eclipse_workspace_dir>:/usr/src/myapp -w /usr/src/myapp myrepo/myimage mvn clean install
it should work.
它应该工作。
For your continuous integration, you can use Docker Jenkins plugin to do the same or with a sh script.
对于您的持续集成,您可以使用 Docker Jenkins 插件或使用 sh 脚本来执行相同的操作。
回答by thSoft
There is Docker Tooling for Eclipse, available from this update site(you also need to add this update siteas for now).
有Docker Tooling for Eclipse,可以从这个更新站点获得(你现在还需要添加这个更新站点)。
回答by Atmega
Try Eclipse-Che https://eclipse.org/che/You can install it as a Docker runs.
尝试 Eclipse-Che https://eclipse.org/che/您可以在 Docker 运行时安装它。
回答by benito
These links were very useful to me :
https://github.com/docker/labs/blob/master/developer-tools/java-debugging/Eclipse-README.md
https://github.com/docker/labs/blob/master/developer-tools/java-debugging/Eclipse-README.md
https://github.com/docker/labs/blob/master/developer-tools/java/chapters/ch07-eclipse.adoc
https://github.com/docker/labs/blob/master/developer-tools/java/chapters/ch07-eclipse.adoc
https://docs.docker.com/samples/
https://docs.docker.com/samples/
It is all about Tutorial: Debugging Java Applications in Docker, Install Docker Tooling in EclipseYou can also Watch a quick video explaining the key steps in https://www.youtube.com/watch?v=XmhEZiS26os
它是所有关于教程:在泊坞调试Java应用程序,安装多克尔工具在Eclipse中,您也可以观看一段简短的视频解释中的关键步骤https://www.youtube.com/watch?v=XmhEZiS26os
To configure remote debugging in Eclipse, click on Run > Debug Configurations...
要在 Eclipse 中配置远程调试,请单击 Run > Debug Configurations...
Tomcat for instance supports remote debugging the Java Platform Debugger Architecture (JPDA). Make sure that the remote debugging was enabled when the tomcat image (registration-webserver) was built.
例如,Tomcat 支持远程调试 Java Platform Debugger Architecture (JPDA)。确保在构建 tomcat 镜像(registration-webserver)时启用了远程调试。