Dockerfiles for OFBiz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Dockerfiles for OFBiz

Michael Brohl-3
Hi everyone,

please have a look at the solutions provided in
https://issues.apache.org/jira/browse/OFBIZ-10407.

The main questions for the mailing list:

1. do we want to add and maintain Docker files in our codebase?

2. if yes, which version should we use?

3. if yes, additionally: would it be a good idea to place OFBiz Docker
images on docker hub and maintain them?

What do you think?

Thanks,

Michael Brohl

ecomify GmbH - www.ecomify.de



smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dockerfiles for OFBiz

taher
Hello Michael,

1. Absolutely from my side. Deployment becomes drastically simpler
2. Which version of what?
3. Hmm, I'm not sure of the purpose / benefit of having that. No one
just "deploys" OFBiz without customization. And even if so, if you
have comfy scripts in the code base, then that would be enough.

Ideally, the way I'd go for it is to have a Dockerfile at the top
level directory and a docker folder to hold everything else.
Deployment can be targeted to multiple different environments  such
that even the development environment can depend on a database engine
like postgres by default.

On Fri, Mar 13, 2020 at 8:06 PM Michael Brohl <[hidden email]> wrote:

>
> Hi everyone,
>
> please have a look at the solutions provided in
> https://issues.apache.org/jira/browse/OFBIZ-10407.
>
> The main questions for the mailing list:
>
> 1. do we want to add and maintain Docker files in our codebase?
>
> 2. if yes, which version should we use?
>
> 3. if yes, additionally: would it be a good idea to place OFBiz Docker
> images on docker hub and maintain them?
>
> What do you think?
>
> Thanks,
>
> Michael Brohl
>
> ecomify GmbH - www.ecomify.de
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Dockerfiles for OFBiz

Pierre Smits-3
As I have stated in the ticket (and it being good enough to repeat it here):

I have been working on a solution that will enable users
(developers/adopters/etc.) to generate containers, that either will be
based:


   - on a branch (trunk or whatever) without plugins and git-aware
   - on a branch with plugins git-aware
   - on a release without plugins
   - on a release with plugins


And for the latter two I am looking at how to have it production-ready.


Having docker hub working with it is a good idea. I started testing that
angle a short while ago. It is an additional means to spread, and enables
the project to control/direct some flow of dissemination. And for some
(developers and/or potential adopters) it is a starting point.

Met vriendelijke groet,

Pierre Smits
*Proud* *contributor** of* Apache OFBiz <https://ofbiz.apache.org/> since
2008 (without privileges)

*Apache Trafodion <https://trafodion.apache.org>, Vice President*
*Apache Directory <https://directory.apache.org>, PMC Member*
Apache Incubator <https://incubator.apache.org>, committer
Apache Steve <https://steve.apache.org>, committer


On Fri, Mar 13, 2020 at 6:22 PM Taher Alkhateeb <[hidden email]>
wrote:

> Hello Michael,
>
> 1. Absolutely from my side. Deployment becomes drastically simpler
> 2. Which version of what?
> 3. Hmm, I'm not sure of the purpose / benefit of having that. No one
> just "deploys" OFBiz without customization. And even if so, if you
> have comfy scripts in the code base, then that would be enough.
>
> Ideally, the way I'd go for it is to have a Dockerfile at the top
> level directory and a docker folder to hold everything else.
> Deployment can be targeted to multiple different environments  such
> that even the development environment can depend on a database engine
> like postgres by default.
>
> On Fri, Mar 13, 2020 at 8:06 PM Michael Brohl <[hidden email]>
> wrote:
> >
> > Hi everyone,
> >
> > please have a look at the solutions provided in
> > https://issues.apache.org/jira/browse/OFBIZ-10407.
> >
> > The main questions for the mailing list:
> >
> > 1. do we want to add and maintain Docker files in our codebase?
> >
> > 2. if yes, which version should we use?
> >
> > 3. if yes, additionally: would it be a good idea to place OFBiz Docker
> > images on docker hub and maintain them?
> >
> > What do you think?
> >
> > Thanks,
> >
> > Michael Brohl
> >
> > ecomify GmbH - www.ecomify.de
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Dockerfiles for OFBiz

Michael Brohl-3
In reply to this post by taher
Hi Taher,


Am 13.03.20 um 18:21 schrieb Taher Alkhateeb:
> Hello Michael,
>
> 1. Absolutely from my side. Deployment becomes drastically simpler
> 2. Which version of what?

There is a pull request from Pierre, see my remarks towards this version
in the issue comments.

I've provided an alternative, see patch file attached to the issue.


> 3. Hmm, I'm not sure of the purpose / benefit of having that. No one
> just "deploys" OFBiz without customization. And even if so, if you
> have comfy scripts in the code base, then that would be enough.
>
> Ideally, the way I'd go for it is to have a Dockerfile at the top
> level directory and a docker folder to hold everything else.
> Deployment can be targeted to multiple different environments  such
> that even the development environment can depend on a database engine
> like postgres by default.

Thanksks for your suggestions, Taher.

Michael


>
> On Fri, Mar 13, 2020 at 8:06 PM Michael Brohl <[hidden email]> wrote:
>> Hi everyone,
>>
>> please have a look at the solutions provided in
>> https://issues.apache.org/jira/browse/OFBIZ-10407.
>>
>> The main questions for the mailing list:
>>
>> 1. do we want to add and maintain Docker files in our codebase?
>>
>> 2. if yes, which version should we use?
>>
>> 3. if yes, additionally: would it be a good idea to place OFBiz Docker
>> images on docker hub and maintain them?
>>
>> What do you think?
>>
>> Thanks,
>>
>> Michael Brohl
>>
>> ecomify GmbH - www.ecomify.de
>>
>>


smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dockerfiles for OFBiz

Michael Brohl-3
In reply to this post by taher
Hi Taher,

Am 13.03.20 um 18:21 schrieb Taher Alkhateeb:

> Hello Michael,
>
> 1. Absolutely from my side. Deployment becomes drastically simpler
> 2. Which version of what?
> 3. Hmm, I'm not sure of the purpose / benefit of having that. No one
> just "deploys" OFBiz without customization. And even if so, if you
> have comfy scripts in the code base, then that would be enough.
>
> Ideally, the way I'd go for it is to have a Dockerfile at the top
> level directory and a docker folder to hold everything else.
> Deployment can be targeted to multiple different environments  such
> that even the development environment can depend on a database engine
> like postgres by default.
I have an idea how to solve this with a more sophisticated Docker file
together with the config mechanism we use here at ecomify. Describing
this for a proposal to contribute is still on my agenda.

This would allow configuring everything and build a docker image by just
copying a a single (or multiple staged) files during the build process.
This would allow to configure every single property used in OFBiz
(database, ports, security etc.) and build targeted images from that.

Let's see when I find time...

Michael




smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dockerfiles for OFBiz

taher
Sounds great. I would recommend a combination of docker +
docker-compose + scripts + environment files to get everything fully
automated and also parameterized

On Fri, Mar 13, 2020 at 10:00 PM Michael Brohl <[hidden email]> wrote:

>
> Hi Taher,
>
> Am 13.03.20 um 18:21 schrieb Taher Alkhateeb:
> > Hello Michael,
> >
> > 1. Absolutely from my side. Deployment becomes drastically simpler
> > 2. Which version of what?
> > 3. Hmm, I'm not sure of the purpose / benefit of having that. No one
> > just "deploys" OFBiz without customization. And even if so, if you
> > have comfy scripts in the code base, then that would be enough.
> >
> > Ideally, the way I'd go for it is to have a Dockerfile at the top
> > level directory and a docker folder to hold everything else.
> > Deployment can be targeted to multiple different environments  such
> > that even the development environment can depend on a database engine
> > like postgres by default.
>
> I have an idea how to solve this with a more sophisticated Docker file
> together with the config mechanism we use here at ecomify. Describing
> this for a proposal to contribute is still on my agenda.
>
> This would allow configuring everything and build a docker image by just
> copying a a single (or multiple staged) files during the build process.
> This would allow to configure every single property used in OFBiz
> (database, ports, security etc.) and build targeted images from that.
>
> Let's see when I find time...
>
> Michael
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Dockerfiles for OFBiz

Daniel Watford
In reply to this post by Pierre Smits-3
Hi Pierre,

Sorry for coming back to this so late, but I thought I'd share how I have my project setup for docker and pushing to a test environment in case its of any use to you.

I'm working on a plugin called Activate, built against Ofbiz R18.

My work area is structured as:
- activate-docker-ofbiz-framework (private repo)
- - local-config
- - - environment-seed-data.xml
- - - plugins
- - - - activate (private repo)

The activate-docker-ofbiz-framework project exists to build a docker image of ofbiz both with and without the plugin.

The build.gradle file and .dockerignore file are attached. See task buildOfbizBaseImage in build.gradle.

In build.gradle I'm using the com.bmuschko.docker-remote-api plugin to construct a Dockerfile and build an image. I preferred the idea of keeping as much build information in build.gradle rather than spreading it out across build.gradle and a separate Dockerfile.

Building Dockerfile on the fly gives opportunities to create different variants of docker images.

In this case I can build the ofbiz image from the activate-docker-ofbiz-framework directory with:
 ./gradlew buildOfbizBaseImage

Once the base image is built, I extend it to include my plugin using:
   ./gradlew buildOfbizBaseImage  

I separate building the two images for performance reasons, although these aren't massive savings.


Next I can run the new image with docker-compose (see attached docker-compose-standalone.yml file):
  docker-compose -f docker-compose-standalone.yml up

Here ofbiz is launched in the container using: ./gradlew "ofbiz --load-data dir=local-config" ofbiz

The --load-data argument causes the environment-seed-data.xml file to be loaded, in this case to set the admin user's password to 'ofbiz' without the need to change the password when they log in.

Visit https://localhost:8443/  (you may need to vary the hostname depending on your docker environment).


The above approach works well for me as I have some Azure DevOps pipelines triggered from updates to git repositories to build my image, push to my docker repository and then restart docker-compose running in my test environment. 

The local-config directory in each test environment can hold different data to load when the environment is brought up, configuring user accounts and passwords as needed. 

Hope this helps,

Dan.



On Fri, 13 Mar 2020 at 17:37, Pierre Smits <[hidden email]> wrote:
As I have stated in the ticket (and it being good enough to repeat it here):

I have been working on a solution that will enable users
(developers/adopters/etc.) to generate containers, that either will be
based:


   - on a branch (trunk or whatever) without plugins and git-aware
   - on a branch with plugins git-aware
   - on a release without plugins
   - on a release with plugins


And for the latter two I am looking at how to have it production-ready.


Having docker hub working with it is a good idea. I started testing that
angle a short while ago. It is an additional means to spread, and enables
the project to control/direct some flow of dissemination. And for some
(developers and/or potential adopters) it is a starting point.

Met vriendelijke groet,

Pierre Smits
*Proud* *contributor** of* Apache OFBiz <https://ofbiz.apache.org/> since
2008 (without privileges)

*Apache Trafodion <https://trafodion.apache.org>, Vice President*
*Apache Directory <https://directory.apache.org>, PMC Member*
Apache Incubator <https://incubator.apache.org>, committer
Apache Steve <https://steve.apache.org>, committer


On Fri, Mar 13, 2020 at 6:22 PM Taher Alkhateeb <[hidden email]>
wrote:

> Hello Michael,
>
> 1. Absolutely from my side. Deployment becomes drastically simpler
> 2. Which version of what?
> 3. Hmm, I'm not sure of the purpose / benefit of having that. No one
> just "deploys" OFBiz without customization. And even if so, if you
> have comfy scripts in the code base, then that would be enough.
>
> Ideally, the way I'd go for it is to have a Dockerfile at the top
> level directory and a docker folder to hold everything else.
> Deployment can be targeted to multiple different environments  such
> that even the development environment can depend on a database engine
> like postgres by default.
>
> On Fri, Mar 13, 2020 at 8:06 PM Michael Brohl <[hidden email]>
> wrote:
> >
> > Hi everyone,
> >
> > please have a look at the solutions provided in
> > https://issues.apache.org/jira/browse/OFBIZ-10407.
> >
> > The main questions for the mailing list:
> >
> > 1. do we want to add and maintain Docker files in our codebase?
> >
> > 2. if yes, which version should we use?
> >
> > 3. if yes, additionally: would it be a good idea to place OFBiz Docker
> > images on docker hub and maintain them?
> >
> > What do you think?
> >
> > Thanks,
> >
> > Michael Brohl
> >
> > ecomify GmbH - www.ecomify.de
> >
> >
>


--
Daniel Watford

environment-seed-data.xml (286 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dockerfiles for OFBiz

Daniel Watford
Hi Pierre,

As a quick follow up which might be useful to you...

I've created a docker-ofbiz github project at
https://github.com/danwatford/ofbiz-docker which uses gradle to construct
the Dockerfile on the fly when building the image.

Blog post here -
https://www.watfordconsulting.com/2020/04/01/building-apache-ofbiz-docker-images/



On Wed, 25 Mar 2020 at 15:28, Daniel Watford <[hidden email]> wrote:

> Hi Pierre,
>
> Sorry for coming back to this so late, but I thought I'd share how I have
> my project setup for docker and pushing to a test environment in case its
> of any use to you.
>
> I'm working on a plugin called Activate, built against Ofbiz R18.
>
> My work area is structured as:
> - activate-docker-ofbiz-framework (private repo)
> - - local-config
> - - - environment-seed-data.xml
> - - ofbiz (https://github.com/danwatford/ofbiz-framework forked from
> https://github.com/apache/ofbiz-framework)
> - - - plugins
> - - - - activate (private repo)
>
> The activate-docker-ofbiz-framework project exists to build a docker image
> of ofbiz both with and without the plugin.
>
> The build.gradle file and .dockerignore file are attached. See
> task buildOfbizBaseImage in build.gradle.
>
> In build.gradle I'm using the com.bmuschko.docker-remote-api plugin to
> construct a Dockerfile and build an image. I preferred the idea of keeping
> as much build information in build.gradle rather than spreading it out
> across build.gradle and a separate Dockerfile.
>
> Building Dockerfile on the fly gives opportunities to create different
> variants of docker images.
>
> In this case I can build the ofbiz image from the
> activate-docker-ofbiz-framework directory with:
>  ./gradlew buildOfbizBaseImage
>
> Once the base image is built, I extend it to include my plugin using:
>    ./gradlew buildOfbizBaseImage
>
> I separate building the two images for performance reasons, although these
> aren't massive savings.
>
>
> Next I can run the new image with docker-compose (see attached
> docker-compose-standalone.yml file):
>   docker-compose -f docker-compose-standalone.yml up
>
> Here ofbiz is launched in the container using: ./gradlew "ofbiz
> --load-data dir=local-config" ofbiz
>
> The --load-data argument causes the environment-seed-data.xml file to be
> loaded, in this case to set the admin user's password to 'ofbiz' without
> the need to change the password when they log in.
>
> Visit https://localhost:8443/  (you may need to vary the hostname
> depending on your docker environment).
>
>
> The above approach works well for me as I have some Azure DevOps pipelines
> triggered from updates to git repositories to build my image, push to my
> docker repository and then restart docker-compose running in my test
> environment.
>
> The local-config directory in each test environment can hold different
> data to load when the environment is brought up, configuring user accounts
> and passwords as needed.
>
> Hope this helps,
>
> Dan.
>
>
>
> On Fri, 13 Mar 2020 at 17:37, Pierre Smits <[hidden email]> wrote:
>
>> As I have stated in the ticket (and it being good enough to repeat it
>> here):
>>
>> I have been working on a solution that will enable users
>> (developers/adopters/etc.) to generate containers, that either will be
>> based:
>>
>>
>>    - on a branch (trunk or whatever) without plugins and git-aware
>>    - on a branch with plugins git-aware
>>    - on a release without plugins
>>    - on a release with plugins
>>
>>
>> And for the latter two I am looking at how to have it production-ready.
>>
>>
>> Having docker hub working with it is a good idea. I started testing that
>> angle a short while ago. It is an additional means to spread, and enables
>> the project to control/direct some flow of dissemination. And for some
>> (developers and/or potential adopters) it is a starting point.
>>
>> Met vriendelijke groet,
>>
>> Pierre Smits
>> *Proud* *contributor** of* Apache OFBiz <https://ofbiz.apache.org/> since
>> 2008 (without privileges)
>>
>> *Apache Trafodion <https://trafodion.apache.org>, Vice President*
>> *Apache Directory <https://directory.apache.org>, PMC Member*
>> Apache Incubator <https://incubator.apache.org>, committer
>> Apache Steve <https://steve.apache.org>, committer
>>
>>
>> On Fri, Mar 13, 2020 at 6:22 PM Taher Alkhateeb <
>> [hidden email]>
>> wrote:
>>
>> > Hello Michael,
>> >
>> > 1. Absolutely from my side. Deployment becomes drastically simpler
>> > 2. Which version of what?
>> > 3. Hmm, I'm not sure of the purpose / benefit of having that. No one
>> > just "deploys" OFBiz without customization. And even if so, if you
>> > have comfy scripts in the code base, then that would be enough.
>> >
>> > Ideally, the way I'd go for it is to have a Dockerfile at the top
>> > level directory and a docker folder to hold everything else.
>> > Deployment can be targeted to multiple different environments  such
>> > that even the development environment can depend on a database engine
>> > like postgres by default.
>> >
>> > On Fri, Mar 13, 2020 at 8:06 PM Michael Brohl <[hidden email]
>> >
>> > wrote:
>> > >
>> > > Hi everyone,
>> > >
>> > > please have a look at the solutions provided in
>> > > https://issues.apache.org/jira/browse/OFBIZ-10407.
>> > >
>> > > The main questions for the mailing list:
>> > >
>> > > 1. do we want to add and maintain Docker files in our codebase?
>> > >
>> > > 2. if yes, which version should we use?
>> > >
>> > > 3. if yes, additionally: would it be a good idea to place OFBiz Docker
>> > > images on docker hub and maintain them?
>> > >
>> > > What do you think?
>> > >
>> > > Thanks,
>> > >
>> > > Michael Brohl
>> > >
>> > > ecomify GmbH - www.ecomify.de
>> > >
>> > >
>> >
>>
>
>
> --
> Daniel Watford
>


--
Daniel Watford