GithubHelp home page GithubHelp logo

Comments (7)

vemonet avatar vemonet commented on June 2, 2024

Here is an example of a Dockerfile to build Java we use usually (1 stage with maven to build the jar, 1 stage with a light JRE to execute the jar : https://github.com/MaastrichtU-IDS/xml2rdf/blob/master/Dockerfile

Compiling a jar allow you to avoid any issues related to changing the path where the application is used within your container

Commands to run the test pod and connect to it (from the d2s-argo-workflow repo):

kubectl create -f tests/test-devnull-pod.yaml
kubectl exec -it test-devnull-pod -- /bin/bash

from rdfunit.

vemonet avatar vemonet commented on June 2, 2024

I fixed RDFUnit to be packaged as a standalone jar in the RDFUnit Docker container. So using it from any path with any workdir set will work (available at https://hub.docker.com/repository/docker/umids/rdfunit )

What has been done:

  • added the shade plugin from the profile cli-standalone to the default build plugins in the pom.xml (using profiles was not clear)
  • rewriting the Dockerfile to build the standalone jar in a maven container before running it in a openjdk slim container
  • use absolute path to run the jar in the Docker entrypoint

See commits:

See the new Dockerfile
It is working perfectly fine, let me know if that interest you

We could avoid to change the pom.xml by selection the cli-standalone profile when running mvn package, but not sure how to do it

from rdfunit.

jimkont avatar jimkont commented on June 2, 2024

Thanks for the report @vemonet
I agree that using a fat jar is a better option for running RDFUnit in docker

I like your change, my only concern is that by adding the shade plugin inside the default maven profile, it will be running for every maven execution and possibly delay other dev processes.

We could easily add it in a separate profile (i.e. standaloneJar) and add -PstandaloneJar in the docker command, wdyt?

from rdfunit.

vemonet avatar vemonet commented on June 2, 2024

Hi @jimkont , yes that was my thought also

I rewrote the change to edit only the Dockerfile to properly use the cli-standalone profile when running mvn package

See commit vemonet@2452b1b

And see the Dockerfile: https://github.com/vemonet/RDFUnit/blob/develop/Dockerfile

I kept /usr/src/myapp as workdir, but we could use something shorter if you want, like /app

Additionally this also fix RDFUnit to be used in CWL workflows (CWL redefine the Docker workdir) 🙂

I did a pull request if that works for you: #99

from rdfunit.

k00ni avatar k00ni commented on June 2, 2024

What is the status here?

from rdfunit.

jimkont avatar jimkont commented on June 2, 2024

@vemonet can you check if we can close this issue? Is there anything else pending after your Merge request (#99)?

from rdfunit.

vemonet avatar vemonet commented on June 2, 2024

@jimkont it is working as expected now, thanks a lot!

from rdfunit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.