I have a docker build that during the build needs to run the server for some admin configuration. By running the server it claims a port and during multi-platform build this conflicts with the docker buildx
command as it claims that the port is already in use.
Now I would like to run the build sequentially instead of in parallel but that does not seem to be an option?
I've tried to make this work by setting the cpus to 1 (--cpuset-cpus 1
) but that does not seem to make a difference.
docker buildx build --platform=linux/amd64,linux/arm64/v8 --cpuset-cpus 1 --push -t ivonet/payara .
So is it possible to run this build with parallel disabled?
I've done a bit of research on it now and I have not found a satisfactory answer other than that it does not seem to be possible at this time to disable the parallelism.
I did find a workaround that works for me and steps nicely around this issue. I now use actual remote servers to build the target platforms I need.
In essence, one defines a remote (through ssh) server with docker installed on it and you configure it to build specific targets. That way it can actually run in parallel as the physically different machines can handle the formally overlapping port number (as was the problem in my use case).
Read the full blog post on it here