FROM openjdk:11-slim as service-twitter-builder MAINTAINER Michael Winsauer COPY . /build WORKDIR /build RUN ["./mvnw", "--batch-mode", "--quiet", "-Dmaven.test.skip", "package"] FROM openjdk:11-jre-slim as service-twitter MAINTAINER Michael Winsauer VOLUME /tmp EXPOSE 8084 RUN ["useradd", "--no-create-home", "twitter"] USER twitter:twitter COPY --from=service-twitter-builder /build/target/service-twitter-0.1.0-SNAPSHOT.jar /app/service-twitter.jar WORKDIR /app ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "service-twitter.jar"]