spring-cloud / spring-cloud-deployer

The Spring Cloud Deployer project defines an SPI for deploying long lived applications and short lived tasks
162 stars 87 forks source link

Local Deployer - Docker - Network property is being ignored #451

Open lukas-schw opened 4 months ago

lukas-schw commented 4 months ago

When using the local deployer to deploy a containerized application the network property for Docker (deployer.*.local.docker.network) is being ignored. The cause for this seems to be, that in the DockerCommandBuilder constructor the dockerNetwork is set: https://github.com/spring-cloud/spring-cloud-deployer/blob/062e8cb60a7e88430992405c2f7c358fb792c919/spring-cloud-deployer-local/src/main/java/org/springframework/cloud/deployer/spi/local/DockerCommandBuilder.java#L64-L66 and then reused when building the execution command: https://github.com/spring-cloud/spring-cloud-deployer/blob/062e8cb60a7e88430992405c2f7c358fb792c919/spring-cloud-deployer-local/src/main/java/org/springframework/cloud/deployer/spi/local/DockerCommandBuilder.java#L104-L107 instead of using localDeployerProperties.getDocker().getNetwork() analogous to the other properties like volume mountings.

This problem was also already reported in the old local deployer repository: https://github.com/spring-cloud/spring-cloud-deployer-local/issues/199#issue-772498183