GoogleContainerTools/jib · error · GradleException
container.workingDirectory is not an absolute Unix-style pat
Error message
container.workingDirectory is not an absolute Unix-style path: ${invalidPathValue} What it means
container.workingDirectory must be an absolute Unix-style path (e.g. /workspace) because it becomes the WORKDIR in the image. Jib throws InvalidWorkingDirectoryException when the configured value is relative or not a Unix path, and the Gradle task wraps it in this GradleException.
Source
Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildImageTask.java:133
PluginConfigurationProcessor.createJibBuildRunnerForRegistryImage(
new GradleRawConfiguration(jibExtension),
ignored -> Optional.empty(),
projectProperties,
globalConfig,
new GradleHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))
.runBuild();
} catch (InvalidAppRootException ex) {
throw new GradleException(
"container.appRoot is not an absolute Unix-style path: " + ex.getInvalidPathValue(), ex);
} catch (InvalidContainerizingModeException ex) {
throw new GradleException(
"invalid value for containerizingMode: " + ex.getInvalidContainerizingMode(), ex);
} catch (InvalidWorkingDirectoryException ex) {
throw new GradleException(
"container.workingDirectory is not an absolute Unix-style path: "
+ ex.getInvalidPathValue(),
ex);
} catch (InvalidPlatformException ex) {
throw new GradleException(
"from.platforms contains a platform configuration that is missing required values or has invalid values: "
+ ex.getMessage()
+ ": "
+ ex.getInvalidPlatform(),
ex);
} catch (InvalidContainerVolumeException ex) {
throw new GradleException(
"container.volumes is not an absolute Unix-style path: " + ex.getInvalidVolume(), ex);
} catch (InvalidFilesModificationTimeException ex) {
throw new GradleException(
"container.filesModificationTime should be an ISO 8601 date-time (see "View on GitHub (pinned to fb949e2676)
Solutions
- Use a fully qualified Unix path with a leading slash, e.g. workingDirectory = '/app'.
- Remove workingDirectory to fall back to Jib's default work directory.
- Normalize any Windows path input in scripts that generate the config.
Example fix
// before
jib {
container { workingDirectory = 'workspace' }
}
// after
jib {
container { workingDirectory = '/workspace' }
} Defensive patterns
Strategy: validation
Validate before calling
def wd = jib.container.workingDirectory
if (wd != null && !(wd ==~ '^/[A-Za-z0-9._/-]+$')) {
throw new GradleException("workingDirectory must be an absolute Unix path, got: $wd")
} Try / catch
try {
tasks.named('jib').get().execute()
} catch (GradleException e) {
if (e.message?.startsWith('container.workingDirectory is not')) {
logger.error("Fix workingDirectory (must start with '/'): ${e.message}")
}
throw e
} Prevention
- Use leading-slash Unix paths for any Docker-image path setting.
- Skip Windows drive letters even when building on Windows hosts.
- Keep workingDirectory defined in one shared build script.
When it happens
Trigger: Setting jib.container.workingDirectory to a relative path ('workspace'), an empty string, or a Windows-style path, then running any jib build task.
Common situations: Windows developers entering 'C:\\workdir' or backslash paths; forgetting the leading slash; copying Dockerfile WORKDIR syntax with relative paths; programmatic plugin usage passing null-like or relative values from another config source.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- container.appRoot is not an absolute Unix-style path: ${inva
- container.workingDirectory is not an absolute Unix-style pat
- container.volumes is not an absolute Unix-style path: ${inva
- container.appRoot is not an absolute Unix-style path: ${inva
- container.volumes is not an absolute Unix-style path: ${inva
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/b62dd5429d0f2e88.
Report an issue: GitHub.