[Container-tools] Success with Eclipse+"CDK"

Xavier Coulon xcoulon at redhat.com
Fri Nov 20 15:39:27 UTC 2015


> On 20 Nov 2015, at 15:14, Burr Sutter <bsutter at redhat.com> wrote:
> 
> Very good info

Thanks ;-)

> 
> I just got this working last night, I need to spend more time with it. 
> 
> Some things for discussion:
> 1) What if we had a button that was both Maven and Docker build? 

sure, you can add a maven docker builder in your pom.xml.
Eg:

<plugin>
	<groupId>com.spotify</groupId>
	<artifactId>docker-maven-plugin</artifactId>
	<version>0.3.5</version>
	<configuration>
		<imageName>kitchensink-app</imageName>
		<baseImage>wildfly-postgres:9.0.2.Final</baseImage>
		<cmd>["/opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0"]</cmd>
		<!-- copy the service's jar file from target into the root directory of 
			the image -->
		<resources>
			<resource>
				<targetPath>/opt/jboss/wildfly/standalone/deployments/</targetPath>
				<directory>${project.build.directory}</directory>
				<include>${project.build.finalName}.war</include>
			</resource>
		</resources>
	</configuration>
</plugin>

Just adapt the FROM <image name> that you want to use.

BTW, there are tons of other maven plugins for Docker - I picked this one because it could do what I wanted  (but did not demo) and interestingly, it's developped by Spotify who also made the Java client for Docker that we use in our Eclipse tooling.

For Devoxx, I showed how to build 2 images for WildFly with support for PostgreSQL using the Dockerfiles in https://github.com/xcoulon/devoxx2015 <https://github.com/xcoulon/devoxx2015>
I kept them out of the project as I think this is not a direct project concern.


> 2) Here is the simple project
> https://github.com/burrsutter/dockerized_javaee6angularjs <https://github.com/burrsutter/dockerized_javaee6angularjs>
> Note the Dockerfile in the project root - is that what we want?

Not sure about that. As I explained before, I did not need to build an image with the application, since I relied on container volumes to deploy it.

> 3) More +mysql project
> https://github.com/burrsutter/dockerized_javaee6angularjsmysql <https://github.com/burrsutter/dockerized_javaee6angularjsmysql>
> Note: the standalone.xml, -ds.xml and jdbc driver .jar in the project root
> I know this is not the “right” way to handle this - we will need to discuss and determine the right way
> 
> 

See link above for creating images, if this can help.

Best regards,
/Xavier
> On November 20, 2015 at 3:38:15 AM, Xavier Coulon (xcoulon at redhat.com <mailto:xcoulon at redhat.com>) wrote:
> 
>> Burr,
>> 
>> Watching your video: 
>> 
>> - The launcher to build a Dockerfile is going to be improved and you'll be able to name and tag the image that you build (instead of "dockerfile"): https://bugs.eclipse.org/bugs/show_bug.cgi?id=474196 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=474196> (patch is to be reviewed on Gerrit).
>> 
>> - As far as "Remove Images" (plural) is concerned: I have another patch to rename commands with "Run...", "Delete", "Start", etc. to match the Eclipse vocabulary (as users would be familiar with those terms). And we also have a patch to remove the restriction on a single container or image for those commands.
>> 
>> - Also, Roland integrated the support for Terminal.tm in replacement of the console which gives a much nicer output because terminal.tm understands the special character at the beginning of each line in the Wildfly logs. To enable support for Terminal.tm in replacement for the default console, you need to select both the "Keep stdin open to Console.. " and "Allocate pseudo-TTY from console.." option in the "Run.." wizard. I believe these options should be enabled by default, btw. I would also suggest you to unselect the "Request time stamp for logs" in the Eclipse preferences (Docker>Logging) since Wildfly already provides timestamps in its logs.
>> 
>> [shameless plug] If you want to get an idea of what where we are going with the Docker tooling, you can check the demo that I gave last week at Devoxx, which shows some features that are not merged yet but that we plan to include before the December release: https://youtu.be/tq58w0DYmgc?t=614 <https://youtu.be/tq58w0DYmgc?t=614> - with my French accent, as usual ;-)
>> 
>> - Another interesting feature that was not explicitly mentioned during the demo is that we will create a launch configuration for each container, which means that once the container has been created, users will be able to create a copy or delete/recreate the same container using the previous settings (ports, volumes, links and environment variables). This should be available soon, too. But again, we need 
>> 
>> - To respond about MySQL env variables, yes, you need to click on the "Next" button in the wizard to fill the variables (we could not fill all settings on a single wizard page).
>> 
>> Ping me if you have more questions
>> 
>> Best regards,
>> Xavier
>> 
>>> On 20 Nov 2015, at 08:40, Max Rydahl Andersen <manderse at redhat.com <mailto:manderse at redhat.com>> wrote:
>>> 
>>> Taking the liberty to cc'ing this to container-tools@ since I find it useful for others to see what works (and what does not :)
>>> 
>>>> Based on 
>>>> https://brewweb.devel.redhat.com/taskinfo?taskID=10116077 <https://brewweb.devel.redhat.com/taskinfo?taskID=10116077>
>>>> http://pkgs.devel.redhat.com/cgit/rpms/adb-atomic-bundle/plain/components/rhel/rhel-docker-eclipse/Vagrantfile?h=cdk2.0-rhel-7
>>>> 
>>>> I was able to get a my old demo projects [1][2] working via Eclipse - using the nightly Docker and nightly JBoss Tools (Eclipse Mars.1).
>>> 
>>> Great!
>>> 
>>> For those watching it, this "just" shows the generic docker tooling. None of the "CDK enhanced" features are in this (yet).
>>> 
>>>> https://vimeo.com/146347864 <https://vimeo.com/146347864>
>>>> password: vagrant
>>> 
>>> Answers to some of the questions you raised in here:
>>> 
>>> 
>>> 4:21 selection not working in editor - I've pinged Konstantin on that. It should work.
>>> 
>>> 7:00 you get the spring icon on your app because browsers tend to aggressively cache favicon's and I reckon the last time it cached localhost:8080 you were running a spring app :)
>>> 
>>> btw. Eclipse Mars has a decent terminal now - try cmd+3 "local terminal" - sometimes useful to avoid having to swap too much back and forth in videos/demos/talks.
>>> 
>>>> I did send a different email to Xavier earlier in the evening (my evening) asking about how to express the MySQL docker run statement in Eclipse.
>>>> 
>>>> docker run --name mysqldb -p 3306:3306 -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -e MYSQL_DATABASE=sample -e  MYSQL_ROOT_PASSWORD=supersecret -d mysql
>>> 
>>> There is "Next" button on the wizard :)
>>> 
>>> ![](cid:954F4C68-E814-4456-8E88-6E2E6B615397 at redhat.com <cid:954F4C68-E814-4456-8E88-6E2E6B615397 at redhat.com> "Run_a_Docker_Image_and_1____Downloads_MyEclipse_2015_OSS_org_jboss_ide_eclipse_core_src-genuitec__zsh_.png")
>>> 
>>> 
>>> ![](cid:535D57DB-B057-4D0C-B8FA-007FF5107A50 at redhat.com <cid:535D57DB-B057-4D0C-B8FA-007FF5107A50 at redhat.com> "Run_a_Docker_Image.png")
>>> 
>>> Hope the above images explain it enough ;)
>>> 
>>> One note of warning: the current nightly docker don't provide a way to *rerun* images so you have to manually enter the above again and again. Xavier has a patch for it waiting to be included - that will help immensely on actually using docker actively.
>>> 
>>> One feature I've requested since day one is that we could parse a docker CLI to setup this wizard and likewise generate a docker cli based on the wizard.... but I haven't convinced Jeff et.al. yet on the usefulness of this.
>>> 
>>>> [1] https://github.com/burrsutter/docker_tutorial <https://github.com/burrsutter/docker_tutorial>
>>>> [2] https://github.com/burrsutter/docker_mysql_tutorial <https://github.com/burrsutter/docker_mysql_tutorial>
>>> 
>>> 
>>> /max
>>> http://about.me/maxandersen <http://about.me/maxandersen>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/container-tools/attachments/20151120/a41816f1/attachment.htm>


More information about the Container-tools mailing list