This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
jib { | |
... | |
container { | |
... | |
environment = [ | |
"JAVA_TOOL_OPTIONS": "-Xmx2048m -XX:+UseG1GC", | |
"SPRING_PROFILES_ACTIVE": "dev", | |
"TZ": "Asia/Seoul" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker pull gaemi/jib-example-case3:0.0.1-SNAPSHOT | |
0.0.1-SNAPSHOT: Pulling from gaemi/jib-example-case3 | |
b377b68410ab: Already exists | |
a6f3b7407b73: Already exists | |
2e557c5ffe45: Already exists | |
0f4bec5bfdb3: Pull complete | |
11b2842c59e4: Pull complete | |
bd47a8e115da: Pull complete | |
Digest: sha256:38616e0909335af75e5922571231e7180130e2372616f4058df889c44f1096bf | |
Status: Downloaded newer image for gaemi/jib-example-case3:0.0.1-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./gradlew jib | |
> Task :jib | |
Containerizing application to gaemi/jib-example-case3, gaemi/jib-example-case3:0.0.1-SNAPSHOT, gaemi/jib-example-case3:20190916231246... | |
Container entrypoint set to [java, -cp, /app/resources:/app/classes:/app/libs/*, gaemi.jib.excample.JibExampleApplication] | |
Built and pushed image as gaemi/jib-example-case3, gaemi/jib-example-case3:0.0.1-SNAPSHOT, gaemi/jib-example-case3:20190916231246 | |
Executing tasks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
... | |
id 'com.google.cloud.tools.jib' version '1.6.0' | |
} | |
... | |
jib { | |
from { | |
image = "docker://openjdk:8-jre-alpine" // 로컬환경에 설치되어 있는 도커데몬에서 Base Image 를 가져온다. (지금 상황에서는 굳이 원격에서 가져올 필요가 없으므로...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker history gaemi/jib-example-case2:0.0.1-SNAPSHOT | |
IMAGE CREATED CREATED BY SIZE COMMENT | |
2930d5df5273 2 minutes ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-cp" … 0B | |
9e99a2f5a473 2 minutes ago /bin/sh -c #(nop) COPY dir:179cbb1d67743c51b… 1.58kB | |
88ecae50d982 2 minutes ago /bin/sh -c #(nop) COPY dir:1e687029241ea6545… 244B | |
c24816892d9e 2 minutes ago /bin/sh -c #(nop) COPY dir:c90e3b30c007c92d5… 16.7MB | |
227d4b6dbeb9 2 minutes ago /bin/sh -c #(nop) ARG DEPENDENCY=target/dep… 0B | |
28e2f37bfabf 45 minutes ago /bin/sh -c #(nop) VOLUME [/tmp] 0B | |
f7a292bbb70c 4 months ago /bin/sh -c set -x && apk add --no-cache o… 79.4MB | |
<missing> 4 months ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
task unpack(type: Copy) { | |
dependsOn bootJar | |
from(zipTree(tasks.bootJar.outputs.files.singleFile)) | |
into("build/dependency") | |
} | |
docker { | |
name "gaemi/jib-example-case2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-jre-alpine | |
VOLUME /tmp | |
ARG DEPENDENCY=target/dependency | |
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib | |
COPY ${DEPENDENCY}/META-INF /app/META-INF | |
COPY ${DEPENDENCY}/BOOT-INF/classes /app | |
ENTRYPOINT ["java","-cp","app:app/lib/*","gaemi.jib.example.JibExampleApplication"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker history gaemi/jib-example-case1:0.0.1-SNAPSHOT | |
IMAGE CREATED CREATED BY SIZE COMMENT | |
a45929596df7 18 minutes ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-Djav… 0B | |
5eb6f0189686 18 minutes ago /bin/sh -c #(nop) COPY file:017dd97a0a9b9253… 16.8MB | |
31f9502c38a5 18 minutes ago /bin/sh -c #(nop) ARG JAR_FILE 0B | |
28e2f37bfabf 18 minutes ago /bin/sh -c #(nop) VOLUME [/tmp] 0B | |
f7a292bbb70c 4 months ago /bin/sh -c set -x && apk add --no-cache o… 79.4MB | |
<missing> 4 months ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B | |
<missing> 4 months ago /bin/sh -c #(nop) ENV JAVA_VERSION=8u212 0B | |
<missing> 4 months ago /bin/sh -c #(nop) ENV PATH=/usr/local/sbin:… 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker run --rm -p 8080:8080 -t gaemi/jib-example-case1 | |
________ .__ | |
/ _____/_____ ____ _____ |__| | |
/ \ ___\__ \ _/ __ \ / \| | | |
\ \_\ \/ __ \\ ___/| Y Y \ | | |
\______ (____ /\___ >__|_| /__| | |
\/ \/ \/ \/ | |
2019-09-16 12:19:28.830 INFO 1 --- [ main] gaemi.jib.example.JibExampleApplication : Starting JibExampleApplication on 0aa8816699f2 with PID 1 (/app.jar started by root in /) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./gradlew dockerPush | |
> Task :dockerPush | |
The push refers to repository [docker.io/gaemi/jib-example-case1] | |
5d676bc10c33: Preparing | |
edd61588d126: Preparing | |
9b9b7f3d56a0: Preparing | |
f1b5933fe4b5: Preparing | |
f1b5933fe4b5: Layer already exists | |
9b9b7f3d56a0: Layer already exists |
NewerOlder