Skip to content

Instantly share code, notes, and snippets.

@OtherDevOpsGene
Last active November 1, 2020 19:24
Show Gist options
  • Save OtherDevOpsGene/2dc8a5d4f44007e19533438b106d2649 to your computer and use it in GitHub Desktop.
Save OtherDevOpsGene/2dc8a5d4f44007e19533438b106d2649 to your computer and use it in GitHub Desktop.
Smaller Dockerfile for Docker Workshop
FROM ubuntu:latest AS development
RUN apt-get update && apt-get install -y --no-install-recommends \
default-jdk-headless maven git \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/OtherDevOpsGene/helloworld.git
WORKDIR helloworld
RUN mvn clean package
FROM openjdk:alpine AS runtime
COPY --from=development /helloworld/target/helloworld-1.1.jar /
CMD ["java", "-cp", "/helloworld-1.1.jar", \
"com.coveros.demo.helloworld.HelloWorld"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment