[ 
https://issues.apache.org/jira/browse/FINERACT-1196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17212029#comment-17212029
 ] 

Aleksandar Vidakovic commented on FINERACT-1196:
------------------------------------------------

[~vorburger] Always good to see a different perspective... no one discouraged 
here ;)

For most of what you said I can see the argument, but I would add the following:
 * I'm not necessarily clinging to JIB (just looked more sophisticated like the 
one I use currently in other projects); it's more like a placeholder (I've used 
a plugin from Palantir that works OK, has less bells and whistles; and if I'm 
not mistaken the Spring Boot plugin also has support for Docker?)
 * my argument for the Gradle plugin was to have one build tool and one place 
to read the configuration (build.gradle) instead of having to switch "contexts" 
and executing additional commands in a terminal; isn't it easier to just have 
everything with a "./gradlew clean build jib" (replace "jib" with the relevant 
Docker plugin task)? And people who don't have Docker just do "./gradlew clean 
build" as before...
 * concerning the docker-compose.yml file: I would just point it to the local 
Docker image (I agree that everything remote that needs additional credentials 
etc. is tedious; in this case not necessary); in other projects I use Docker 
Compose files like that for debugging (connecting to the JVM via remote 
debugging) which is super convenient, because you don't have to take care of 
all those external resources like Mysql
 * concerning the JDBC driver JAR: there's a different way how we could do this 
(see code below). Instead of using Spring Boot's JarLauncher we could replace 
it with PropertiesLauncher. If no other parameters are provided then both 
launchers will behave the same. But with PropertiesLauncher you have now the 
possibility to add additional external libraries by setting the system property 
"loader.path"... nice thing about this approach: we don't need to chop up the 
Fineract's Spring Boot uberjar with "java -xf"

 
{code:java}
// in build.gradle
bootJar {
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
    manifest {
        attributes 'Main-Class': 
'org.springframework.boot.loader.PropertiesLauncher'
    }
}
{code}
... and then on the command line (or in a starter script) you could do 
something like this (assuming the Spring Boot uberjar is in the same directory):
{code:java}
# on the console or in a script
mkdir libs
wget -q 
https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.20/mysql-connector-java-8.0.20.jar
 -o libs/mysql-connector-java-8.0.20.jar
java -jar -Dloader.path=$(pwd)/libs/mysql-connector-java-8.0.20.jar 
fineract-provider-1.3.1.jar
{code}
Just my 2 cents :)

 

 

> Use Google JIB Gradle plugin to build Docker images
> ---------------------------------------------------
>
>                 Key: FINERACT-1196
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1196
>             Project: Apache Fineract
>          Issue Type: Improvement
>          Components: Build
>    Affects Versions: 1.4.0
>            Reporter: Aleksandar Vidakovic
>            Assignee: Aleksandar Vidakovic
>            Priority: Major
>             Fix For: 1.5.0
>
>
> Please see here for more information: 
> [https://github.com/GoogleContainerTools/jib]
> The goal here would be to reduce build time (by a lot; no more Gradle build 
> inside a Docker container) and getting independent of CLI tools (and the 
> Docker daemon); and we could get rid off the separate Dockerfile, could 
> reference just the Docker image in docker-compose.yml (instead of using it as 
> yet another build file). 
> There are some nice bonuses using this plugin: JIB will create a layered 
> Docker image which should help reducing the size of the image.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to