skip to Main Content

I am trying to run a few docker containers on GCP VMs. As of today, when I run a docker-compose, my ssh connection breaks. This was not happening as of this morning. The only thing that changed was I did a sudo apt update && sudo apt upgrade.

An example of a docker-compose file that breaks the connection:

version: '3'
services:
  mongo:
    container_name: mongo
    image: mongo
    expose:
      - "27017"
    ports:
      - "27017:27017"

I’m on Ubuntu 5.13.0-1030-gcp #36~20.04.1-Ubuntu SMP Fri Jun 3 15:33:42 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux.

docker-compose version 1.25.0

Docker version 20.10.17, build 100c701

and I’m using BuildKit for my Docker and docker-compose builds.

I’m not sure how to debug this issue, any suggestions would be appreciated. Will update the post with more info if needed.

3

Answers


  1. Do not update your kernel,new kernel will influence docker process

    Login or Signup to reply.
  2. Check your dmesg to see if the kernel crashed.
    Probably related to https://www.mail-archive.com/[email protected]/msg482001.html

    Login or Signup to reply.
  3. in our case it was an internal ip address space exhaustion
    because docker switches afterwards to the 192.168.. network

    and blocks external traffic

    to fix – shutdown all docker containers
    purge all docker networks
    add or append to docker daemon.json

    e.g. vi /etc/docker/daemon.json for 512 networks

    {
        "default-address-pools":[
            {"base":"172.20.0.0/16","size":24},
            {"base":"172.21.0.0/16","size":24}
        ]
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search