-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Adds settings.xml to java-base #3
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
base: master
Are you sure you want to change the base?
Conversation
This will hopefully allow the compilation of java services in docker
frankvanrietimqs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fritz I'm not suer why we
| && apt-get install openjdk-8-jre -y | ||
| RUN apt update && \ | ||
| apt install -y \ | ||
| openjdk-8-jdk \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why we need JDK? We won't be developing on top of this image?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL;DR: its adds 10mb to the image.
The idea is that the jar file gets created using this docker image. We do this with all our other services. It dramatically reduces the build job setups.
| ARG Maven_Snapshots_Deployment | ||
| ARG Maven_Github_gerhardvanwyk | ||
| RUN mkdir -p /root/.m2 | ||
| RUN echo "<settings> \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again I don't think we need to be able to build in this container. Having said that:
So every image and therefore every project will have its own maven repository. This means that we will have a massive amount of duplication of the many shared libraries. It also means that it becomes awkward if you want to build locally using chnages pushed to your local .m2 folder?
Maybe I'm missing what you are trying to do?
We took this approach on our side: https://github.com/IMQS/imqs-wip-service/blob/team-asset-containers/build.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm... so two parts
-
What I was trying to do with including the settings file in the base images is affectingly addressing the issues that the build.sh is bringing up in the start of the file. This keeps everything contained and self sustained. There is no dependency on the machine building the jar because everything is all ready setup inside the container.
-
Crap... making changes in your local .m2 folder... thats a good point... as rare as this case may be, It will still be very annoying the day that someone wants to do something like this... The only solution I can think of is doing the same thing that we do for maps, and that is to build the base image with your changes your self. I could add a second dockerfile that copys your local .m2 into the container to streamline this process?
This will allow developers to create a java-base image useing their local .m2 folder
|
@frankvanrietimqs I have added a second dockerfile and a script to use it. This should satisfy the desire to be able to test a service in docker with changes to local .m2 folder |
|
@frankvanrietimqs do you mind if I just merge this? |
Dogmatix lookup fails, replaced with IP.
Doing this allows us to only add this file once, and not in every dockerization of each java service.
The passwords are added using Jenkins. eg http://cimaster01:8080/job/java-base/configure.
Refs: ASG-4511