Tag: maven

How to execute .jar from pom.xml from cloned project in Dockerfile

I have this in my Dockerfile: FROM maven:3.3-jdk-8-alpine RUN mkdir -p /usr/src/app WORKDIR /usr/src/app RUN apk add –no-cache curl tar bash wget git RUN git clone https://MyProfile@bitbucket.org/MyProfile/myproject.git RUN cd myproject WORKDIR /usr/src/app/myproject ONBUILD ADD . / ONBUILD RUN mvn install EXPOSE 4568 CMD [“java”,”-jar”,”/usr/src/app/myproject/target/ReadDocFile.jar”] I was able to figure out how to install pom from […]

Docker maven and jenkins, mvn install failed requesting junit:junit:jar:3.x

I have a maven 3.2.5 docker image and a jenkins image built from the maven image. Maven image Dockerfile: from dockerfile/java:oracle-java7 ENV MAVEN_VERSION 3.2.5 RUN curl -sSL http://mirror.bit.edu.cn/apache/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf – -C /usr/share \ && mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \ && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn #ADD settings.xml /usr/share/maven/conf/ ENV MAVEN_HOME /usr/share/maven CMD [“mvn”] Jenkins Dockerfile: […]

Maven build, test and run on a docker machine

It’s probably too soon to ask this question but I hope someone has already had the same problem as me. I have to build a jar that run on a centos7, openjdk-7 machine. I created a docker machine in a ridiculously short time 🙂 but my issue is more a maven one. My questions is […]

Docker images contain old maven dependencies

I’m using shippable for building docker images. The issue I’m facing is, docker images contain the old maven dependencies along with the new ones which causes problem for class loading. I verified that during the build creation the build folder only has the desired jars. But when image is packaged and shipped to dockerhub, old […]

Ubuntu 14.04 – wget is hanging

I am trying to run install maven in my Docker image using this command: RUN wget –no-proxy –no-verbose -O /tmp/apache-maven-3.2.2.tar.gz http://archive.apache.org/dist/maven/maven-3/3.2.2/binaries/apache-maven-3.2.2-bin.tar.gz But it just hangs in the command line terminal. No output, nothing after that. I don’t even get prompted to enter another command in the shell until I hit ctrl + C. EDIT 1: […]

maven builds fails inside ubuntu vagrant machine as well as docker instance

I am developing an api using jaxb. The maven build (using jdk-7) works on my local windows machine. Now if I try to build it on my vagrant box (ubuntu/trusty64) after setting up maven and openjdk7 on the vm, I get following error on performing mvn clean install: java.io.FileNotFoundException (operation not permitted) There are in […]

Define application properties on build using Spring Boot and Maven

I have a spring boot application that uses a database. I have the local configuration in the application.properties file. I understand it is possible to change the values when I build the project with maven. I want to set the production values (db on AWS). Here is application.properties spring.datasource.url=${db.url:jdbc:postgresql://localhost:5432/mydb} spring.datasource.username=${db.username:localusername} spring.datasource.password=${db.password:localpassword} I would like to […]

mvn jetty:run not reflecting changes when run inside docker

I have a simple Tic-tac-toe Java web app https://github.com/rajaraodv/tictactoe It is a Maven project. It uses Jetty to run the web app by doing mvn jetty:run While it is running locally, I can easily modify a JavaScript file and see the changes immediately when I refresh the browser. But, when I run it via Docker […]

Authorization settings problems for tomcat while deploying with docker

I am new here and also new to the docker and tomcat. I am trying to deploy a maven project with docker. I have managed to create an image for tomcat in docker and created a container from that image. https://0.0.0.0:49153// or https://172.17.42.1:49153/ gives me the apache tomcat opening page; but whenever i try to […]

Dockerfile does not find local files in a maven project

I am trying to run a java maven project in a container and following is my Dockerfile. FROM base_image:tag # Copy the fat jar inside the image ADD module/target/app.jar somewhere/on/image/docker_app.jar # What to run when the container starts ENTRYPOINT [“java”, “-jar”, “somewhere/on/image/docker_app.jar”] #Ports used by App EXPOSE 8080 But when I run docker build from […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.