abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
18.73k stars 381 forks source link

Failed to bind port: address already in use - for all ports #1075

Closed nehalist closed 1 month ago

nehalist commented 1 month ago

Description

For some reason I'm unable to start my container due to

Error response from daemon: driver failed programming external connectivity on endpoint shopware (container id): failed to bind port 127.123.38.0:22/tcp: Error starting userland proxy: listen tcp4 127.123.38.0:22: bind: address already in use

It doesn't even matter what IP or port I use - the error stays the same. Here's my docker compose:

version: '3'

services:
  shop:
    container_name: shop
    image: dockware/dev:6.3.1.0
    ports:
      - "${EXPOSE_IP}:80:80"
      - "${EXPOSE_IP}:3312:3306"
      - "${EXPOSE_IP}:22:22"
      - "${EXPOSE_IP}:8888:8888"
      - "${EXPOSE_IP}:9999:9999"
    #volumes:
    #  - "./src:/var/www/html"
    #  - "./src:/var/www/html/custom/plugins"
    networks:
      - web
    environment:
      - XDEBUG_ENABLED=0

## ***********************************************************************
##  NETWORKS
## ***********************************************************************
networks:
  web:
    external: false

EXPOSE_IP is a simple env variable that's set to 127.123.38.0. I've tried to change the port mapping to not use a IP at all, which also didn't work.

Version

colima version 0.6.10 git commit: 12c0c834633986e1c05ec2bd2d53c6cb06c89aef

runtime: docker arch: aarch64 client: v26.1.3 server: v27.0.3 limactl version 0.22.0 qemu-img version 9.0.2 Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers

Operating System

Output of colima status

INFO[0000] colima is running using macOS Virtualization.Framework INFO[0000] arch: aarch64 INFO[0000] runtime: docker INFO[0000] mountType: virtiofs INFO[0000] socket: unix:///Users/kh/.colima/default/docker.sock

Reproduction Steps

  1. colima start
  2. docker-compose up -d
  3. Error

Expected behaviour

There should be no error.

Additional context

No response

nehalist commented 1 month ago

My fault, made a mistake in checking what was on port 22 - and, obviously, there was a process that occupied this port.