Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleDockerfile
FROM maven:3.6.3-openjdk-8-slim AS build
WORKDIR /usr/app
COPY . /usr/app
RUN mvn clean package -Dmaven.test.skip=true

FROM openjdk:8-jre-alpine
COPY --from=build /usr/app/target/*.jar /app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app.jar"]
Info

maven:3.5-jdk-8

openjdk:8-jdk-alpine



Docker Image Build

Code Block
## Docker images를 생성합니다.
[root@workspace-vm reactive-link-shortener-sample-app]# docker build -t reactor-demo:1.0 .
Sending build context to Docker daemon  25.35MB
Step 1/4 : FROM openjdk:8-jdk-alpine
8-jdk-alpine: Pulling from library/openjdk
bdf0201b3a05: Pull complete 
9e12771959ad: Pull complete 
018b76c3c533: Pull complete 
Digest: sha256:ced4c16db19a0c7a813bb33ba379b7f7fdf48ce096c57750eb911b4bd928ffa9
Status: Downloaded newer image for openjdk:8-jdk-alpine
 ---> ece449e0acb8
Step 2/4 : COPY target/*.jar app.jar
 ---> 274a6f613050
Step 3/4 : EXPOSE 8080
 ---> Running in b540382aa918
Removing intermediate container b540382aa918
 ---> f2236a423d06
Step 4/4 : ENTRYPOINT ["java","-jar","/app.jar"]
 ---> Running in 508bf9cdfdaf
Removing intermediate container 508bf9cdfdaf
 ---> cb99c11f4409
Successfully built cb99c11f4409
Successfully tagged reactor-demo:1.0
[root@workspace-vm reactive-link-shortener-sample-app]# docker images
REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
reactor-demo                  1.0                 cb99c11f4409        10 seconds ago      130MB
openjdk                       8-jdk-alpine        ece449e0acb8        12 hours ago        105MB
redis                         latest              a55fbf438dfd        5 weeks ago         95MB
quay.io/testcontainers/ryuk   0.2.2               527073eb32d1        15 months ago       9.31MB
redis                         4.0.2               8f2e175b3bd1        18 months ago       107MB
[root@workspace-vm reactive-link-shortener-sample-app]# 

...