You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "KARR, DAVID" <dk...@att.com> on 2016/08/10 15:44:50 UTC

Strategies for building Docker image for Tomcat with Maven-built webapps with docker-maven-plugin

I have a simple multi-project build (just two projects), and the webapps produced from the two projects will be deployed to Tomcat (TomEE, actually).  The TomEE instance requires some non-standard configuration for these apps to work.

I'm considering having a third subproject using the docker-maven-plugin to produce an image with Tomcat and the two webapps deployed to it.

The idea seems straightforward, but there are some details I want to clean up.

For instance, the Dockerfile is going to have to copy the two webapps into the Tomcat distro.  At a minimum, I have to figure out how to get the two war files built from the peer projects into the Docker context so I can build the image.  I'd also like to ensure that when/if I change the artifact versions of the subprojects, I only need minimal changes to get the new version into the image.

What do I need to make this happen?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Strategies for building Docker image for Tomcat with Maven-built webapps with docker-maven-plugin

Posted by Dan Tran <da...@gmail.com>.
that works too

-D

On Mon, Aug 15, 2016 at 10:52 AM, KARR, DAVID <dk...@att.com> wrote:

> > -----Original Message-----
> > From: Dan Tran [mailto:dantran@gmail.com]
> > Sent: Monday, August 15, 2016 10:28 AM
> > To: Maven Users List <us...@maven.apache.org>
> > Subject: Re: Strategies for building Docker image for Tomcat with Maven-
> > built webapps with docker-maven-plugin
> >
> > use destFileName
> > http://maven.apache.org/plugins/maven-dependency-plugin/copy-
> > mojo.html#artifactItems
>
> Ok.  After some research, I think that perhaps just setting "stripVersion"
> to true might be all that I need.
>
> > On Mon, Aug 15, 2016 at 10:22 AM, KARR, DAVID <dk...@att.com> wrote:
> >
> > > > -----Original Message-----
> > > > From: Dan Tran [mailto:dantran@gmail.com]
> > > > Sent: Wednesday, August 10, 2016 9:15 AM
> > > > To: Maven Users List <us...@maven.apache.org>
> > > > Subject: Re: Strategies for building Docker image for Tomcat with
> > > > Maven- built webapps with docker-maven-plugin
> > > >
> > > > <dependencies> with optoinal set to true is your friend at docker
> > > > module.
> > > > Then use maven-dependency-plugin to copy the war files into staging
> > > > directory where docker file can consume it
> > >
> > > Getting back to this, one aim that I have is for the Docker build to
> > > not care about the artifact versions, so somehow the dependency copy
> > > has to remove the version number from the artifact file.  What is the
> > > best way to do this?
> > >
> > > > On Wed, Aug 10, 2016 at 8:44 AM, KARR, DAVID <dk...@att.com> wrote:
> > > >
> > > > > I have a simple multi-project build (just two projects), and the
> > > > > webapps produced from the two projects will be deployed to Tomcat
> > > > > (TomEE, actually).  The TomEE instance requires some non-standard
> > > > > configuration for these apps to work.
> > > > >
> > > > > I'm considering having a third subproject using the
> > > > > docker-maven-plugin to produce an image with Tomcat and the two
> > > > webapps deployed to it.
> > > > >
> > > > > The idea seems straightforward, but there are some details I want
> > > > > to clean up.
> > > > >
> > > > > For instance, the Dockerfile is going to have to copy the two
> > > > > webapps into the Tomcat distro.  At a minimum, I have to figure
> > > > > out how to get the two war files built from the peer projects into
> > > > > the Docker context so I can build the image.  I'd also like to
> > > > > ensure that when/if I change the artifact versions of the
> > > > > subprojects, I only need minimal changes to get the new version
> > into the image.
> > > > >
> > > > > What do I need to make this happen?
> > > > >
> > > > > ------------------------------------------------------------------
> > > > > --- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > For additional commands, e-mail: users-help@maven.apache.org
> > > > >
> > > > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

RE: Strategies for building Docker image for Tomcat with Maven-built webapps with docker-maven-plugin

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: Dan Tran [mailto:dantran@gmail.com]
> Sent: Monday, August 15, 2016 10:28 AM
> To: Maven Users List <us...@maven.apache.org>
> Subject: Re: Strategies for building Docker image for Tomcat with Maven-
> built webapps with docker-maven-plugin
> 
> use destFileName
> http://maven.apache.org/plugins/maven-dependency-plugin/copy-
> mojo.html#artifactItems

Ok.  After some research, I think that perhaps just setting "stripVersion" to true might be all that I need.

> On Mon, Aug 15, 2016 at 10:22 AM, KARR, DAVID <dk...@att.com> wrote:
> 
> > > -----Original Message-----
> > > From: Dan Tran [mailto:dantran@gmail.com]
> > > Sent: Wednesday, August 10, 2016 9:15 AM
> > > To: Maven Users List <us...@maven.apache.org>
> > > Subject: Re: Strategies for building Docker image for Tomcat with
> > > Maven- built webapps with docker-maven-plugin
> > >
> > > <dependencies> with optoinal set to true is your friend at docker
> > > module.
> > > Then use maven-dependency-plugin to copy the war files into staging
> > > directory where docker file can consume it
> >
> > Getting back to this, one aim that I have is for the Docker build to
> > not care about the artifact versions, so somehow the dependency copy
> > has to remove the version number from the artifact file.  What is the
> > best way to do this?
> >
> > > On Wed, Aug 10, 2016 at 8:44 AM, KARR, DAVID <dk...@att.com> wrote:
> > >
> > > > I have a simple multi-project build (just two projects), and the
> > > > webapps produced from the two projects will be deployed to Tomcat
> > > > (TomEE, actually).  The TomEE instance requires some non-standard
> > > > configuration for these apps to work.
> > > >
> > > > I'm considering having a third subproject using the
> > > > docker-maven-plugin to produce an image with Tomcat and the two
> > > webapps deployed to it.
> > > >
> > > > The idea seems straightforward, but there are some details I want
> > > > to clean up.
> > > >
> > > > For instance, the Dockerfile is going to have to copy the two
> > > > webapps into the Tomcat distro.  At a minimum, I have to figure
> > > > out how to get the two war files built from the peer projects into
> > > > the Docker context so I can build the image.  I'd also like to
> > > > ensure that when/if I change the artifact versions of the
> > > > subprojects, I only need minimal changes to get the new version
> into the image.
> > > >
> > > > What do I need to make this happen?
> > > >
> > > > ------------------------------------------------------------------
> > > > --- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

Re: Strategies for building Docker image for Tomcat with Maven-built webapps with docker-maven-plugin

Posted by Dan Tran <da...@gmail.com>.
use destFileName
http://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html#artifactItems

-D

On Mon, Aug 15, 2016 at 10:22 AM, KARR, DAVID <dk...@att.com> wrote:

> > -----Original Message-----
> > From: Dan Tran [mailto:dantran@gmail.com]
> > Sent: Wednesday, August 10, 2016 9:15 AM
> > To: Maven Users List <us...@maven.apache.org>
> > Subject: Re: Strategies for building Docker image for Tomcat with Maven-
> > built webapps with docker-maven-plugin
> >
> > <dependencies> with optoinal set to true is your friend at docker
> > module.
> > Then use maven-dependency-plugin to copy the war files into staging
> > directory where docker file can consume it
>
> Getting back to this, one aim that I have is for the Docker build to not
> care about the artifact versions, so somehow the dependency copy has to
> remove the version number from the artifact file.  What is the best way to
> do this?
>
> > On Wed, Aug 10, 2016 at 8:44 AM, KARR, DAVID <dk...@att.com> wrote:
> >
> > > I have a simple multi-project build (just two projects), and the
> > > webapps produced from the two projects will be deployed to Tomcat
> > > (TomEE, actually).  The TomEE instance requires some non-standard
> > > configuration for these apps to work.
> > >
> > > I'm considering having a third subproject using the
> > > docker-maven-plugin to produce an image with Tomcat and the two
> > webapps deployed to it.
> > >
> > > The idea seems straightforward, but there are some details I want to
> > > clean up.
> > >
> > > For instance, the Dockerfile is going to have to copy the two webapps
> > > into the Tomcat distro.  At a minimum, I have to figure out how to get
> > > the two war files built from the peer projects into the Docker context
> > > so I can build the image.  I'd also like to ensure that when/if I
> > > change the artifact versions of the subprojects, I only need minimal
> > > changes to get the new version into the image.
> > >
> > > What do I need to make this happen?
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
>

RE: Strategies for building Docker image for Tomcat with Maven-built webapps with docker-maven-plugin

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: Dan Tran [mailto:dantran@gmail.com]
> Sent: Wednesday, August 10, 2016 9:15 AM
> To: Maven Users List <us...@maven.apache.org>
> Subject: Re: Strategies for building Docker image for Tomcat with Maven-
> built webapps with docker-maven-plugin
> 
> <dependencies> with optoinal set to true is your friend at docker
> module.
> Then use maven-dependency-plugin to copy the war files into staging
> directory where docker file can consume it

Getting back to this, one aim that I have is for the Docker build to not care about the artifact versions, so somehow the dependency copy has to remove the version number from the artifact file.  What is the best way to do this?

> On Wed, Aug 10, 2016 at 8:44 AM, KARR, DAVID <dk...@att.com> wrote:
> 
> > I have a simple multi-project build (just two projects), and the
> > webapps produced from the two projects will be deployed to Tomcat
> > (TomEE, actually).  The TomEE instance requires some non-standard
> > configuration for these apps to work.
> >
> > I'm considering having a third subproject using the
> > docker-maven-plugin to produce an image with Tomcat and the two
> webapps deployed to it.
> >
> > The idea seems straightforward, but there are some details I want to
> > clean up.
> >
> > For instance, the Dockerfile is going to have to copy the two webapps
> > into the Tomcat distro.  At a minimum, I have to figure out how to get
> > the two war files built from the peer projects into the Docker context
> > so I can build the image.  I'd also like to ensure that when/if I
> > change the artifact versions of the subprojects, I only need minimal
> > changes to get the new version into the image.
> >
> > What do I need to make this happen?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >

Re: Strategies for building Docker image for Tomcat with Maven-built webapps with docker-maven-plugin

Posted by Dan Tran <da...@gmail.com>.
<dependencies> with optoinal set to true is your friend at docker module.
Then use maven-dependency-plugin to copy the war files into staging
directory where docker file can consume it

-D

On Wed, Aug 10, 2016 at 8:44 AM, KARR, DAVID <dk...@att.com> wrote:

> I have a simple multi-project build (just two projects), and the webapps
> produced from the two projects will be deployed to Tomcat (TomEE,
> actually).  The TomEE instance requires some non-standard configuration for
> these apps to work.
>
> I'm considering having a third subproject using the docker-maven-plugin to
> produce an image with Tomcat and the two webapps deployed to it.
>
> The idea seems straightforward, but there are some details I want to clean
> up.
>
> For instance, the Dockerfile is going to have to copy the two webapps into
> the Tomcat distro.  At a minimum, I have to figure out how to get the two
> war files built from the peer projects into the Docker context so I can
> build the image.  I'd also like to ensure that when/if I change the
> artifact versions of the subprojects, I only need minimal changes to get
> the new version into the image.
>
> What do I need to make this happen?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>