Alex
11/20/2024, 4:12 PMstage('Push Image') {
steps {
withDockerRegistry(credentialsId: 'docker-registry') {
sh '''
export DOCKER_CONFIG=${DOCKER_CONFIG}
gradle pushImage
'''
}
}
}
results in:
2024-11-20T16:41:35.209 + export 'DOCKER_CONFIG=/var/jenkins_home/workspace/Build_Docker_Images_job_tmp/a182165e-2434-45fe-aba4-b83d1ae61d8b'
2024-11-20T16:41:37.341 > Task :app:pushImage FAILED
2024-11-20T16:41:37.341 [PATH:/var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/GRADLE_8_11/gradle-8.11/bin:/var/jenkins_home/tools/hudson.plugins.gradle.GradleInstallation/GRADLE_8_11/gradle-8.11/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/default-jvm/bin, TZ:Europe/Berlin, JAVA_OPTS:-Dfile.encoding=UTF8, LD_LIBRARY_PATH:/usr/lib/jvm/java-17-amazon-corretto/lib/server:/usr/lib/jvm/java-17-amazon-corretto/lib:/usr/lib/jvm/java-17-amazon-corretto/../lib, PWD:/var/jenkins_home/workspace/Build_Docker_Images, LANGUAGE:en_US.UTF-8, BUILD_TAG:jenkins-Build_Docker_Images-145, STAGE_NAME:Clean, JENKINS_HOME:/var/jenkins_home, NODE_NAME:docker-agent-0005meblygbmm, BUILD_DISPLAY_NAME:#145, LC_ALL:en_US.UTF-8, SHLVL:3, GIT_PREVIOUS_COMMIT:8ef95ba05b9c381167598069d716ace83add1048, WORKSPACE_TMP:/var/jenkins_home/workspace/Build_Docker_Images_job_tmp, SOPS_VERSION:3.9.1, JAVA_HOME:/usr/lib/jvm/default-jvm, BUILD_ID:145, LANG:en_US.UTF-8, JOB_NAME:Build_Docker_Images, GRADLE_USER_HOME:.gradle, JAVA_TOOL_OPTIONS:-Dfile.encoding=UTF8, HOME:/var/jenkins_home]
Alex
11/20/2024, 4:14 PMThomas Broyer
11/20/2024, 4:28 PM'''
so that ${DOCKER_CONFIG}
is interpreted by the shell, so if there's already a DOCKER_CONFIG
environment variable you shouldn't need that export
line. Either that or there's no such environment variable and then ${DOCKER_CONFIG}
expands to the empty string.
So maybe change to """
?Alex
11/20/2024, 4:38 PMAlex
11/20/2024, 4:38 PMAlex
11/20/2024, 4:40 PM--no-daemon
for the respective tasks