1. 개요


2. S2I 설치


3. 기본 이미지 Pull

$ sudo docker pull registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift
Using default tag: latest
latest: Pulling from redhat-openjdk-18/openjdk18-openshift
17942523bc4b: Pull complete
4c98734f2433: Pull complete
123e4fdc29b5: Pull complete
Digest: sha256:873f79531ffa5b0783c0ffe6cdbdb05f1bcc0485d27b1aace16a9b062fc5bd77
Status: Downloaded newer image for registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift:latest

4. S2I 빌드

$ s2i build https://github.com/<사용자>/spring-boot-app registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift s2i-spring-boot-app
INFO Performing Maven build in /tmp/src
INFO Using MAVEN_OPTS -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:+ExitOnOutOfMemoryError
INFO Using Apache Maven 3.5.0 (Red Hat 3.5.0-4.3)
Maven home: /opt/rh/rh-maven35/root/usr/share/maven
Java version: 1.8.0_232, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.15.0-1044-aws", arch: "amd64", family: "unix"
INFO Running 'mvn -e -Popenshift -DskipTests -Dcom.redhat.xpaas.repo.redhatga -Dfabric8.skip=true --batch-mode -Djava.net.preferIPv4Stack=true -s /tmp/artifacts/configuration/settings.xml -Dmaven.repo.local=/    tmp/artifacts/m2  package'
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:52 min
[INFO] Finished at: 2019-11-13T02:12:57Z
[INFO] Final Memory: 35M/45M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "openshift" could not be activated because it does not exist.
INFO Copying deployments from target to /deployments...
'/tmp/src/target/spring-boot-app-0.0.1-SNAPSHOT.jar' -> '/deployments/spring-boot-app-0.0.1-SNAPSHOT.jar'
Build completed successfully

5. 도커 이미지 목록

$ sudo docker images
REPOSITORY                                                         TAG                 IMAGE ID            CREATED             SIZE
s2i-spring-boot-app                                                latest              34ae890c2752        45 minutes ago      568MB