当我把Gradle项目修改的时候我遇到了问题。运行级臂
无效的图像引用registry.hub.docker.com/myusername/${rootProject.name},也许您应该检查引用的格式是否正确,例如,斜杠分隔的名称组件不能有大写字母。
根模块
setting.gradle
rootProject.name = 'myproject'
include 'discovery-service'
include 'client-service'
include 'notification-service'
include 'api-gateway'build.gradle
jib {
var tag = 'latest'
from {
image = 'eclipse-temurin:17.0.4.1_1-jre'
}
to {
image = 'registry.hub.docker.com/myUsername/${rootProject.name}'
}
}服务之一
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}
group = 'com.leekify'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
jar {
baseName = 'client-service'
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
....
}
tasks.named('test') {
useJUnitPlatform()
}setting.gradle
rootProject.name = 'client-service'发布于 2022-12-02 13:43:02
对jib.to.image字符串使用双引号而不是单引号,以便Gradle计算变量。
https://stackoverflow.com/questions/74575239
复制相似问题