Skip to content

Commit

Permalink
Drop /tcp prefix
Browse files Browse the repository at this point in the history
This might have been required by old docker versions but it breaks podman
  • Loading branch information
discordianfish committed Jul 13, 2024
1 parent 9a83963 commit 113b486
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/diambra/diambra.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ func (d *Diambra) Start() error {

func newEnvContainer(config *EnvConfig, envID, randomSeed int) (*container.Container, error) {
pm := &container.PortMapping{}
hostPort := "0/tcp"
hostPort := "0"
if config.PreallocatePort {
listener, err := net.Listen("tcp", ":0")
if err != nil {
return nil, err
}
hostPort = fmt.Sprintf("%d/tcp", listener.Addr().(*net.TCPAddr).Port)
hostPort = fmt.Sprintf("%d", listener.Addr().(*net.TCPAddr).Port)
}

pm.AddPortMapping(ContainerPort, hostPort, config.Host)
Expand Down

0 comments on commit 113b486

Please sign in to comment.