GoogleContainerTools / GoogleContainerTools/jib

argument "--start-interval" for docker health check not supported in dockerfile when building images

Open
#4,335 0 comments 0 reactions 0 assignees View on GitHub
enhancement priority:p3
Dominant language
Java
Stars
14.5k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

**Environment**:

- Jib version: 3.4.3
- Build tool: Gradle 8.8
- OS: minideb

**Description of the issue**:

Using the jib gradle-task to build an image does not work with dockerfiles which include a Healthcheck with the argument "--start-interval".
Probably because the correspondig field does not exist in the corresponding jib-configuration (com.google.cloud.tools.jib.configuration.DockerHealthCheck).

**Expected behavior**:

The argument "--start-interval" is recognized correctly when building the image and the image can be published.

**Steps to reproduce**:

1. Use a dockerfile containing a healthcheck with the argument "--start-interval" as the base image.
2. configure the jib task to create an image from the base image
3. run the task

**`jib-gradle-plugin` Configuration**:
(our config, not a minimal config)
```groovy
jib {

from {
image = "wiremock/wiremock:3.9.2-1-alpine"
}
to {
image = "yourImagePath"
tags = [
"your version"
]
auth {
username = "user"
password = "pw"
}
}
container {
entrypoint = 'INHERIT'
ports = ["8080"]
user = "1000"
}
extraDirectories {
paths {
path {
from = file('wiremock-data')
into = '/home/wiremock'
}
}
}
}
```

**Log output**:

> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Unrecognized field "StartInterval" (class com.google.cloud.tools.jib.image.json.ContainerConfigurationTemplate$HealthCheckObjectTemplate), not marked as ignorable (5 known properties: "Timeout", "Test", "StartPeriod", "Interval", "Retries"])
10:28:22 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 649] (through reference chain: com.google.cloud.tools.jib.image.json.ContainerConfigurationTemplate["config"]->com.google.cloud.tools.jib.image.json.ContainerConfigurationTemplate$ConfigurationObjectTemplate["Healthcheck"]->com.google.cloud.tools.jib.image.json.ContainerConfigurationTemplate$HealthCheckObjectTemplate["StartInterval"])

**Additional Information**:

The documentation listing the new argument: [docs](https://docs.docker.com/reference/dockerfile/#healthcheck)

The wiremock dockerfile : [dockerfile](https://github.com/wiremock/wiremock-docker/blob/3.9.2-1/alpine/Dockerfile)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.