Skip to content
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

Could not decode the port mappings on docker 24.0.2 / docker-compose v2.19.1 #378

Open
johannesgiani opened this issue Sep 6, 2023 · 0 comments

Comments

@johannesgiani
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch dockest@3.0.1 for the project I'm working on.

On docker 24.0.2 / docker-compose v2.19.1 I get an error related to port mappings:

Could not decode the port mappings. This is most likely related to a breaking change in the docker-compose format.
Received: {"target":12345,"published":"12345"}

target is of type number but published is a string. There have been several hick-ups with the port mapping I saw in the issue history, so I decided to relax the rule to just accept any type.

Here is the diff that solved my problem:

diff --git a/node_modules/dockest/dist/run/bootstrap/getParsedComposeFile.js b/node_modules/dockest/dist/run/bootstrap/getParsedComposeFile.js
index 33d6857..cb8fe23 100644
--- a/node_modules/dockest/dist/run/bootstrap/getParsedComposeFile.js
+++ b/node_modules/dockest/dist/run/bootstrap/getParsedComposeFile.js
@@ -14,7 +14,7 @@ const Either = __importStar(require("fp-ts/lib/Either"));
 const function_1 = require("fp-ts/lib/function");
 const Errors_1 = require("../../Errors");
 const PortBinding = io.type({
-    published: io.number,
+    published: io.any,
     target: io.number,
 });
 const PortBindingFromString = new io.Type('PortBindingFromComposeString', PortBinding.is, (input, context) => {

This issue body was partially generated by patch-package.

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

No branches or pull requests

1 participant