Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit the Dockerfile to use a jar and multi stage build. #99

Merged
merged 2 commits into from
Jan 14, 2020

Conversation

vemonet
Copy link
Contributor

@vemonet vemonet commented Jan 14, 2020

Edit the Dockerfile to use a jar and multi stage build.

Description

  • rewriting the Dockerfile to build the standalone jar in a maven container before running it in a openjdk slim container
    • First packaging the jar using the cli-standalone profile in a maven container
    • then copying it to a lightweight and clean image to run it
    • use absolute path to run the jar in the Docker entrypoint

Motivation and Context

It allows to avoid issue when the docker runtime is using a different workdir by default (which cause the mvn java:exec to fail)
Allows to run it using:

Issue: #98

How Has This Been Tested?

Tested on Ubuntu 18.04. Part of a workflow containing other components:

**Client Version:** version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.0+d4cacc0", GitCommit:"d4cacc0", GitTreeState:"clean", BuildDate:"2018-10-10T16:38:01Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
**Server Version:** version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
mkdir -p /data/dqa-workspace/output/tmp-outdir
sudo chown -R ${USER}:${USER} /data/dqa-workspace

git clone https://github.com/MaastrichtU-IDS/d2s-cwl-workflows
cd d2s-cwl-workflows

cwl-runner \
  --outdir /data/dqa-workspace/output \
  --tmp-outdir-prefix=/data/dqa-workspace/output/tmp-outdir/ \
  --tmpdir-prefix=/data/dqa-workspace/output/tmp-outdir/tmp- \
  workflows/workflow-dqa.cwl \
  support/config-cwl-dqa.yml

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…ar using the cli-standalone profile, then copying it to a lightweight and clean image to run it. It allows to avoid issue when the docker runtime is using a different workdir by default (which cause the mvn java:exec to fail)
@coveralls
Copy link

coveralls commented Jan 14, 2020

Coverage Status

Coverage remained the same at 54.365% when pulling b38d524 on vemonet:develop into c8ae88a on AKSW:master.

Copy link
Member

@jimkont jimkont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good 👍 we could also shorten the workdir to something like /app as you suggested

@jimkont jimkont merged commit 1f0b364 into AKSW:master Jan 14, 2020
@jimkont
Copy link
Member

jimkont commented Jan 14, 2020

Thank you for your contribution @vemonet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants