GoogleContainerTools/jib · error · GradleException

container.volumes is not an absolute Unix-style path: ${inva

Error message

container.volumes is not an absolute Unix-style path: ${invalidVolume}

What it means

Thrown when an entry in container.volumes is not an absolute Unix-style path. Jib exposes volumes as mount points in the container and validates each starts with '/'. The offending value is included in the GradleException.

Source

Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildDockerTask.java:151

      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 "
              + "DateTimeFormatter.ISO_DATE_TIME) or special keyword \"EPOCH_PLUS_SECOND\": "
              + ex.getInvalidFilesModificationTime(),
          ex);

    } catch (InvalidCreationTimeException ex) {
      throw new GradleException(
          "container.creationTime should be an ISO 8601 date-time (see "
              + "DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\"EPOCH\", "
              + "\"USE_CURRENT_TIMESTAMP\"): "
              + ex.getInvalidCreationTime(),
          ex);

    } catch (JibPluginExtensionException ex) {

View on GitHub (pinned to fb949e2676)

Solutions

  1. Make every volume path absolute Unix-style, e.g. '/data/logs'
  2. Remove any Windows drive-letter paths
  3. Verify each entry starts with '/'

Example fix

// before
jib { container { volumes = ['data/logs'] } }
// after
jib { container { volumes = ['/data/logs'] } }
Defensive patterns

Strategy: validation

Validate before calling

jib.container.volumes.each { v ->
  if (!v.startsWith('/')) throw new GradleException("volume must be absolute Unix path: $v")
}

Try / catch

try { jibBuild.run() } catch (GradleException e) { if (e.message.contains('container.volumes')) { logger.error(e.message) }; throw e }

Prevention

When it happens

Trigger: Adding a volume like volumes = ['/data', 'logs'] where 'logs' is relative, or Windows-style paths like 'C:\data'.

Common situations: Porting Dockerfile VOLUME directives with relative paths, specifying bind-mount-style host paths instead of container paths, or typos dropping the leading slash.

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


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/aa7e27ff1b669b6b. Report an issue: GitHub.