{"record":{"id":"c5bfe24b5be93f9b","repo":"GoogleContainerTools/jib","slug":"missing-target-image-parameter-perhaps-you-should","errorCode":null,"errorMessage":"Missing target image parameter, perhaps you should add a 'jib.to.image' configuration parameter to your build.gradle or set the parameter via the commandline (e.g. 'gradle jib --image <your image name>').","messagePattern":"Missing target image parameter, perhaps you should add a 'jib\\.to\\.image' configuration parameter to your build\\.gradle or set the parameter via the commandline \\(e\\.g\\. 'gradle jib --image <your image name>'\\)\\.","errorType":"console","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildImageTask.java","lineNumber":108,"sourceCode":"      throws IOException, BuildStepsExecutionException, CacheDirectoryCreationException,\n          MainClassInferenceException, InvalidGlobalConfigException {\n    // Asserts required @Input parameters are not null.\n    Preconditions.checkNotNull(jibExtension);\n    TaskCommon.disableHttpLogging();\n    TempDirectoryProvider tempDirectoryProvider = new TempDirectoryProvider();\n\n    GradleProjectProperties projectProperties =\n        GradleProjectProperties.getForProject(\n            getProject(),\n            getLogger(),\n            tempDirectoryProvider,\n            jibExtension.getConfigurationName().get());\n    GlobalConfig globalConfig = GlobalConfig.readConfig();\n    Future<Optional<String>> updateCheckFuture =\n        TaskCommon.newUpdateChecker(projectProperties, globalConfig, getLogger());\n    try {\n      if (Strings.isNullOrEmpty(jibExtension.getTo().getImage())) {\n        throw new GradleException(\n            HelpfulSuggestions.forToNotConfigured(\n                \"Missing target image parameter\",\n                \"'jib.to.image'\",\n                \"build.gradle\",\n                \"gradle jib --image <your image name>\"));\n      }\n\n      PluginConfigurationProcessor.createJibBuildRunnerForRegistryImage(\n              new GradleRawConfiguration(jibExtension),\n              ignored -> Optional.empty(),\n              projectProperties,\n              globalConfig,\n              new GradleHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))\n          .runBuild();\n\n    } catch (InvalidAppRootException ex) {\n      throw new GradleException(\n          \"container.appRoot is not an absolute Unix-style path: \" + ex.getInvalidPathValue(), ex);","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildImageTask.java#L90-L126","documentation":"Jib requires a target image reference to know where to tag/push the built image. This error is thrown by the jibBuild-style task when jib.to.image is null or empty. HelpfulSuggestions adds hints to configure 'jib.to.image' in build.gradle or pass --image on the command line.","triggerScenarios":"Running 'gradle jib' (or a task extending BuildImageTask) when neither jib.to.image is set in the build configuration nor the -Dimage/--image parameter is supplied.","commonSituations":"New projects where only the base image was configured; renaming the extension property (to.image moved under jib.to); running jib locally expecting the image parameter from CI config that isn't present; typo like jib.to.name instead of jib.to.image.","solutions":["Set the target image in build.gradle: jib { to { image = 'registry/myapp:tag' } }.","Pass it on the command line: gradle jib --image=registry/myapp:tag.","Check the property name is exactly to.image under the jib extension.","In multi-module builds, configure to.image in each module that has its own jib task."],"exampleFix":"// before\njib {\n  from { image = 'eclipse-temurin:17' }\n}\n// after\njib {\n  from { image = 'eclipse-temurin:17' }\n  to { image = 'gcr.io/my-project/my-app:1.0.0' }\n}","handlingStrategy":"validation","validationCode":"if (!project.hasProperty('jib.to.image') && (jib.to.image == null || jib.to.image.empty)) {\n  throw new GradleException(\"Set jib.to.image before running jib\")\n}","typeGuard":null,"tryCatchPattern":"try {\n  tasks.named('jib').get().execute()\n} catch (GradleException e) {\n  if (e.message?.startsWith('Missing target image parameter')) {\n    logger.error('Pass --image=registry/app:tag or set jib { to { image = ... } }')\n  }\n  throw e\n}","preventionTips":["Always configure jib.to.image in a shared convention plugin for multi-module builds.","Parameterize the target registry/project in gradle.properties.","Add a preflight task that fails fast when to.image is blank."],"tags":["gradle","jib","configuration","missing-parameter"],"backgroundTag":"missing-required-config-field","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}