-
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?
Changes from all commits
833df83
5343593
8cda012
461dc9a
f2cd9be
580c597
2d48e81
84ad53d
287487a
1cf32eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,84 @@ | ||
| # docker build -t imqs/java-base:8-test --build-arg Maven_Nexus_User=$Maven_Nexus_User --build-arg Maven_Releases_Deployment=$Maven_Releases_Deployment --build-arg Maven_Snapshots_Deployment=$Maven_Snapshots_Deployment --build-arg Maven_Github_gerhardvanwyk=$Maven_Github_gerhardvanwyk . | ||
|
|
||
| FROM imqs/ubuntu-base | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install openjdk-8-jre -y | ||
| RUN apt update && \ | ||
| apt install -y \ | ||
| openjdk-8-jdk \ | ||
| wget && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN wget https://www-us.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz -P /tmp && \ | ||
| tar xf /tmp/apache-maven-*.tar.gz -C /opt && rm /tmp/apache-maven-*.tar.gz && \ | ||
| mv /opt/apache-maven-* /opt/maven | ||
| ENV MAVEN_HOME=/opt/maven | ||
| ENV PATH=${MAVEN_HOME}/bin:${PATH} | ||
|
|
||
| ARG Maven_Nexus_User | ||
| ARG Maven_Releases_Deployment | ||
| 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 commentThe 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: 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmmm... so two parts
|
||
| <mirrors> \ | ||
| <mirror> \ | ||
| <!--This sends everything else to /public --> \ | ||
| <id>nexus</id> \ | ||
| <mirrorOf>*</mirrorOf> \ | ||
| <url>http://192.168.4.40:8081/nexus/content/groups/public</url> \ | ||
| </mirror> \ | ||
| </mirrors> \ | ||
| <profiles> \ | ||
| <profile> \ | ||
| <id>nexus</id> \ | ||
| <!--Enable snapshots for the built in central repo to direct --> \ | ||
| <!--all requests to nexus via the mirror --> \ | ||
| <repositories> \ | ||
| <repository> \ | ||
| <id>central</id> \ | ||
| <url>http://central</url> \ | ||
| <releases><enabled>true</enabled></releases> \ | ||
| <snapshots><enabled>true</enabled></snapshots> \ | ||
| </repository> \ | ||
| </repositories> \ | ||
| <pluginRepositories> \ | ||
| <pluginRepository> \ | ||
| <id>central</id> \ | ||
| <url>http://central</url> \ | ||
| <releases><enabled>true</enabled></releases> \ | ||
| <snapshots><enabled>true</enabled></snapshots> \ | ||
| </pluginRepository> \ | ||
| </pluginRepositories> \ | ||
| </profile> \ | ||
| </profiles> \ | ||
| <activeProfiles> \ | ||
| <!--make the profile active all the time --> \ | ||
| <activeProfile>nexus</activeProfile> \ | ||
| </activeProfiles> \ | ||
| \ | ||
| <servers> \ | ||
| <server> \ | ||
| <id>nexus</id> \ | ||
| <username>user</username> \ | ||
| <password>$Maven_Nexus_User</password> \ | ||
| </server> \ | ||
| <server> \ | ||
| <id>releases</id> \ | ||
| <username>deployment</username> \ | ||
| <password>$Maven_Releases_Deployment</password> \ | ||
| </server> \ | ||
| <server> \ | ||
| <id>snapshots</id> \ | ||
| <username>deployment</username> \ | ||
| <password>$Maven_Snapshots_Deployment</password> \ | ||
| </server> \ | ||
| <server> \ | ||
| <id>github</id> \ | ||
| <username>gerhardvanwyk</username> \ | ||
| <password>$Maven_Github_gerhardvanwyk</password> \ | ||
| </server> \ | ||
| </servers> \ | ||
| </settings>" > /root/.m2/settings.xml | ||
|
|
||
| # Create a symlink to the real log directory | ||
| RUN mkdir -p /imqsvar | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # docker build -t imqs/java-base:8-test . | ||
|
|
||
| FROM imqs/ubuntu-base | ||
|
|
||
| RUN apt update && \ | ||
| apt install -y \ | ||
| openjdk-8-jdk \ | ||
| wget && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN wget https://www-us.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz -P /tmp && \ | ||
| tar xf /tmp/apache-maven-*.tar.gz -C /opt && rm /tmp/apache-maven-*.tar.gz && \ | ||
| mv /opt/apache-maven-* /opt/maven | ||
| ENV MAVEN_HOME=/opt/maven | ||
| ENV PATH=${MAVEN_HOME}/bin:${PATH} | ||
|
|
||
| RUN mkdir -p /root/.m2 | ||
| COPY ./ /root/.m2 | ||
|
|
||
| # Create a symlink to the real log directory | ||
| RUN mkdir -p /imqsvar | ||
| RUN ln -s /var/log/imqs /imqsvar/logs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| dockerfileDir=${PWD} | ||
|
|
||
| cd /home/`whoami`/.m2 && \ | ||
| sudo docker build -t imqs/java-base:8-test -f ${dockerfileDir}/Dockerfile-local-m2 . | ||
|
|
||
| cd $dockerfileDir |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Docker Local m2 | ||
|
|
||
| If you are a developer and you have made changes to your local .m2 folder and | ||
| you are not satisfied with just testing your service natively then this is the | ||
| dockerfile for you. | ||
|
|
||
| By running the script called `build-local-m2` you can build the `java-base` | ||
| image using your own `.m2` folder in your home directory. You can then build | ||
| the docker image for java service and it will automatically use the local m2 | ||
| docker image as a base. |
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.