Skip to content

Commit

Permalink
feat: jib로 OCI 이미지 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
HyungJu committed Mar 16, 2024
1 parent a5a88b1 commit 0b2326e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val activeProfile = System.getenv("PROFILE") ?: "dev"
val imageTag = System.getenv("IMAGE_TAG") ?: "latest"
val repoURL: String? = System.getenv("IMAGE_REPO_URL")

plugins {
id("org.springframework.boot") version "3.2.3"
id("io.spring.dependency-management") version "1.1.4"
id("com.google.cloud.tools.jib") version "3.4.1"
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
kotlin("plugin.jpa") version "1.9.22"
Expand Down Expand Up @@ -56,3 +61,21 @@ tasks.register<Copy>("initConfig") {
include("*.yml")
into("./src/main/resources")
}

jib {
from {
image = "amazoncorretto:17-alpine3.18"
}
to {
image = repoURL
tags = setOf(imageTag)
}
container {
jvmFlags = listOf(
"-Dspring.profiles.active=${activeProfile}",
"-Dserver.port=8080",
"-XX:+UseContainerSupport",
)
ports = listOf("8080")
}
}

0 comments on commit 0b2326e

Please sign in to comment.