Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample
FROM adoptopenjdk/openjdk8-openj9:latest
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd+file:/dev/./urandom","-jar","app.jar"]
------------------------------------------------------------------------------
FROM java:8
VOLUME /tmp
ADD target/microservice-0.0.1-SNAPSHOT.jar user.jar
RUN bash -c 'touch /user.jar'
ENV JAVA_OPTS=""
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /user.jar"]
------------------------------------------------------------------------------
docker build -t spring-petclinic:devoxx . --build-arg JAR_FILE=target/spring-petclinic-2.1.0.BUILD-SNAPSHOT.jar
docker run -e MYSQL_ROOT_PASSWORD=petclinic -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:5.7.8
docker run -p 8080:8080 spring-petclinic:devoxx
docker ps
docker stop fe0e7cb7bd2c
docker history spring-petclinic:devoxx
------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.