You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by James Bognar <ja...@apache.org> on 2019/10/14 13:25:36 UTC

Running maven within Dockerfile.

Ishita is suggesting that the Dockerfile for the petstore app run
maven to build the component.  I don't think I've ever seen this done
before.  Does anyone have any feedback on that request?

Re: Running maven within Dockerfile.

Posted by James Bognar <ja...@apache.org>.
Ishita,

Based on the comments above, it sounds like a good idea.  Go for it.

On Wed, Oct 16, 2019 at 10:23 AM Stian Soiland-Reyes <st...@apache.org> wrote:
>
> On Mon, 14 Oct 2019 15:46:59 +0200, Ayeshmantha Perera <ak...@gmail.com> wrote:
> > It's possible to run the maven build from the same docker file. But
> > normally on CI/CD pipelines, we are doing the build first and then creating
> > the docker images.
> >
> > Regards
> > Ayesh
> >
> > On Mon, Oct 14, 2019 at 3:26 PM James Bognar <ja...@apache.org> wrote:
> >
> > > Ishita is suggesting that the Dockerfile for the petstore app run
> > > maven to build the component.  I don't think I've ever seen this done
> > > before.  Does anyone have any feedback on that request?
> > >
>
> I think it's a good idea to have it, just not to require it.
>
> We do this in another project, it's nice in that you get consistent
> Maven and JDK version and that the Docker image can be auto-built on
> changes to the code, and can depend on native stuff (e.g. Python
> scripts called from Java)
>
> It's not so convenient in that the result of the compilation is trapped
> inside the Docker image - but that's not an issue if the goal is to make
> a web-server or command line container.
>
> See for instance:
> https://github.com/common-workflow-language/cwlviewer/blob/master/Dockerfile
>
> (Apache license, feel free to borrow)
>
> There we actually use that again from Docker Compose because it needs a
> database etc - but that is presumably not needed by the petstore app.
> https://github.com/common-workflow-language/cwlviewer/blob/master/docker-compose.yml
>
>
>
> --
> Stian Soiland-Reyes
> https://orcid.org/0000-0001-9842-9718
>

Re: Running maven within Dockerfile.

Posted by Stian Soiland-Reyes <st...@apache.org>.
On Mon, 14 Oct 2019 15:46:59 +0200, Ayeshmantha Perera <ak...@gmail.com> wrote:
> It's possible to run the maven build from the same docker file. But
> normally on CI/CD pipelines, we are doing the build first and then creating
> the docker images.
> 
> Regards
> Ayesh
> 
> On Mon, Oct 14, 2019 at 3:26 PM James Bognar <ja...@apache.org> wrote:
> 
> > Ishita is suggesting that the Dockerfile for the petstore app run
> > maven to build the component.  I don't think I've ever seen this done
> > before.  Does anyone have any feedback on that request?
> >

I think it's a good idea to have it, just not to require it.

We do this in another project, it's nice in that you get consistent
Maven and JDK version and that the Docker image can be auto-built on
changes to the code, and can depend on native stuff (e.g. Python
scripts called from Java)

It's not so convenient in that the result of the compilation is trapped
inside the Docker image - but that's not an issue if the goal is to make
a web-server or command line container.

See for instance:
https://github.com/common-workflow-language/cwlviewer/blob/master/Dockerfile

(Apache license, feel free to borrow)

There we actually use that again from Docker Compose because it needs a
database etc - but that is presumably not needed by the petstore app.
https://github.com/common-workflow-language/cwlviewer/blob/master/docker-compose.yml



-- 
Stian Soiland-Reyes
https://orcid.org/0000-0001-9842-9718


Re: Running maven within Dockerfile.

Posted by Ayeshmantha Perera <ak...@gmail.com>.
Hi James

It's possible to run the maven build from the same docker file. But
normally on CI/CD pipelines, we are doing the build first and then creating
the docker images.

Regards
Ayesh

On Mon, Oct 14, 2019 at 3:26 PM James Bognar <ja...@apache.org> wrote:

> Ishita is suggesting that the Dockerfile for the petstore app run
> maven to build the component.  I don't think I've ever seen this done
> before.  Does anyone have any feedback on that request?
>