如何找到端口分配?绑定 0.0.0.0:80 失败:端口已分配

如何找到端口分配?绑定 0.0.0.0:80 失败:端口已分配

我的 docker-compose.yml

version: "3"
services:
  redis:
    image: redis
    restart: always
  postgres:
    image: postgres
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: pass
      POSTGRES_DB: outline
    volumes:
      - ./data/pgdata:/var/lib/postgresql/data
    restart: always
  minio:
    image: minio/minio
    volumes:
      - ./data/minio_root:/minio_root:z
      - ./data/certs:/root/.minio/certs:z
    command: "minio server /minio_root"
    env_file: ./env.minio
    restart: always
  outline:
    image: outlinewiki/outline:latest
    command: sh -c "yarn sequelize:migrate --env production-ssl-disabled && yarn start"
    environment:
      - DATABASE_URL=postgres://user:pass@postgres:5432/outline
      - DATABASE_URL_TEST=postgres://user:pass@postgres:5432/outline-test
      - REDIS_URL=redis://redis:6379
    env_file:
      - ./env.outline
      - ./env.slack
    restart: always
    depends_on:
      - postgres
      - redis
      - minio
  nginx:
    image: nginx
    ports:
      - 80:80
      - 4443:443
    volumes:
      - ./data/nginx/:/etc/nginx/conf.d/:z
      - ./data/certs/:/etc/ssl/certs/:z
    restart: always
    depends_on:
      - outline

我正在运行-d

docker-compose up -d
WARNING: Found orphan containers (outline_webserver_1, outline_certbot_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating outline_postgres_1 ... done
Creating outline_redis_1    ... done
Creating outline_minio_1    ... done
Creating outline_outline_1  ... done
Creating outline_nginx_1    ... 
Creating outline_nginx_1    ... error

ERROR: for outline_nginx_1  Cannot start service nginx: driver failed programming external connectivity on endpoint outline_nginx_1 (04142433bde69c0122c47ea24dac5f61018cf3f108ea2e7bd3ab079b18d0ad98): Bind for 0.0.0.0:80 failed: port is already allocated

好的,我们现在检查一下

sudo lsof -i tcp:80 shows nothing

然后

ss -lptn 'sport = :80'
State                Recv-Q                Send-Q                               Local Address:Port                               Peer Address:Port               Process        

相同。

什么可能导致此错误?

相关内容