-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DateTimeParseException when created is not set in image config #8302
Fix DateTimeParseException when created is not set in image config #8302
Conversation
The moby project will add |
08daf57
to
a4d44c5
Compare
@SgtSilvio thanks for your contribution! Just one question, do you have any custom value for the API in docker-java.properties? Testcontainers should be using API version 1.32. You can enable trace logging for |
Thanks for your response @eddumelendez
No, no custom config for docker-java. Unfortunately, the new Docker version returns the empty string timestamp on all api versions, so also 1.32. This will be fixed in an upcoming release of docker: moby/moby#47374 |
Right! missed that part 👍🏽 |
Hey @SgtSilvio, just to update you, we discussed it with the Docker Engine team and it is a breaking change in Docker Engine, that will be fixed with the next Docker Engine patch release. We are still discussing how to best move forward for now. |
@kiview agreed. |
a4d44c5
to
4690675
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good safety check.
f5aa035
to
8ff591c
Compare
@kiview The Docker team has now made the decision to omit the The release notes of 25.0.4 state:
This means:
The last point means that the null checks added in this PR are required for API versions 1.44+. |
The output of docker inspect "Created" field changed: Docker version 24.0.7: "0001-01-01T00:00:00Z" Docker version 25.0.3: ""
8ff591c
to
3f3ad2e
Compare
Thanks for your contribution, @SgtSilvio ! |
Starting a testcontainer fails when using an image that does not set the "created" field in its config (for example
hivemq/hivemq-swarm:4.25.0
) with the following exception:The "created" field is optional according to the OCI Image Format Specification (https://github.com/opencontainers/image-spec/blob/main/config.md#properties). Also, this used to work with older Docker engine versions.
Unfortunately, the "Created" field in the output of the docker inspect command changed in new versions:
"0001-01-01T00:00:00Z"
""
This PR fixes this case by interpreting an empty string as an absent created time.
Additionally
null
is treated the same to cover a possible case when "Created" is also absent in the output of the docker inspect command.The value
Instant.EPOCH
is used to represent an absent created time, because this is how docker represents it in the docker images list command.