FROM openjdk:11-slim as service-twitter-builder LABEL maintainer="Michael Winsauer " COPY . /build WORKDIR /build RUN ["./mvnw", "--batch-mode", "--quiet", "-Dmaven.test.skip", "package"] FROM openjdk:11-jre-slim as service-twitter LABEL maintainer="Michael Winsauer " EXPOSE 8084 VOLUME /tmp 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"]