Skip to content

Conversation

@pipex
Copy link
Contributor

@pipex pipex commented Feb 24, 2025

Docker ImageBuild endpoint requires that the cachefrom option is a "JSON serialized array". This requirement seems to be an exception to the way arrays are consumed by the API (usually querystring serialized).

This change is needed after apocas/docker-modem#181 that makes querystring serialized arrays the default.

This commit adds an exception for this option on Docker.buildImage.

Change-type: patch
Closes: #792

@pipex pipex force-pushed the build-image-from-cache branch from b9b66ef to dd15e14 Compare February 24, 2025 20:42
Docker [ImageBuild](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Image/operation/ImageBuild) endpoint requires
that the `cachefrom` option is a "JSON serialized array". This
requirement seems to be an exception to the way arrays are consumed by
the API (usually querystring serialized).

This change is needed after apocas/docker-modem#181 that makes querystring serialized arrays the default.

This commit adds an exception for this option on `Docker.buildImage`.

Change-type: patch
Closes: apocas#792
@pipex pipex force-pushed the build-image-from-cache branch from dd15e14 to 88597cc Compare February 24, 2025 20:46
pipex added a commit to balena-io-modules/balena-compose that referenced this pull request Feb 24, 2025
A change the way options are serialized in docker-modem causes an issue
with builds using the `cachefrom` option and library tests to fail.
This change can be reverted if apocas/dockerode#793 is merged.

Change-type: patch
Relates-to: apocas/docker-modem#181
Relates-to: apocas/dockerode#792
pipex added a commit to balena-io-modules/balena-compose that referenced this pull request Feb 25, 2025
A change the way options are serialized in docker-modem causes an issue
with builds using the `cachefrom` option and library tests to fail.
This change can be reverted if apocas/dockerode#793 is merged.

Change-type: patch
Relates-to: apocas/docker-modem#181
Relates-to: apocas/dockerode#792
@apocas
Copy link
Owner

apocas commented Mar 6, 2025

Yeah Docker's API never was an example of consistency and sometimes these things happen :(
Will ping when published.

@apocas apocas merged commit 7d73e87 into apocas:master Mar 6, 2025
5 checks passed
@apocas
Copy link
Owner

apocas commented Mar 31, 2025

https://github.com/apocas/dockerode/releases/tag/v4.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The cachefrom option in Docker.buildImage is not JSON serialized

2 participants