-2

Docker login is successful in terminal.

Why then jitDockerBuild fails on Docker Hub auth stage?

Gradle:

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.1.2'
    id 'io.spring.dependency-management' version '1.1.2'
    id 'com.google.cloud.tools.jib' version '3.3.2'
}

group = 'com.app'
version = '0.0.3-SNAPSHOT'

java {
    sourceCompatibility = '17'
}

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.security:spring-security-test'
    testImplementation 'com.github.tomakehurst:wiremock-standalone:3.0.0-beta-10'
}

jib {
    to {
        image = "my-app:${project.version}"
    }
    container {
        ports ['6000']
    }
}

tasks.build.dependsOn tasks.jibDockerBuild

tasks.named('test') {
    useJUnitPlatform()
}

Windows 11 IntelliJ Termnal:

###########> docker login
Authenticating with existing credentials...
Login Succeeded

Logging in with your password grants your terminal complete access to your account.
For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/
###########> ./gradlew jibDockerBuild

> Task :jibDockerBuild FAILED

Containerizing application to Docker daemon as my-app:0.0.3-SNAPSHOT...
Base image 'eclipse-temurin:17-jre' does not use a specific image digest - build may not be reproducible
The base image requires auth. Trying again for eclipse-temurin:17-jre...                                                                                                                                                            
The credential helper (docker-credential-desktop) has nothing for server URL: registry-1.docker.io                                                                                                                                  
                                                                                                                                                                                                                                    
Got output:                                                                                                                                                                                                                         
                                                                                                                                                                                                                                    
credentials not found in native keychain                                                                                                                                                                                            
                                                                                                                                                                                                                                    
The credential helper (docker-credential-desktop) has nothing for server URL: registry.hub.docker.com                                                                                                                               
                                                                                                                                                                                                                                    
Got output:                                                                                                                                                                                                                         
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 4s
3 actionable tasks: 1 executed, 2 up-to-date
J.Olufsen
  • 13,415
  • 44
  • 120
  • 185

0 Answers0