Containers take a long time to start

I’m using Laradock, but for some reason the containers are taking a long time to start, as you can see in the screenshot. How can I resolve this?

Docker Desktop 4.16.2
PopOs 22.04

1 Like

PopOS is not a supported Linux distribution for Docker Desktop. Although it is based on Ubuntu, it is not an Ubuntu, but I don’t know if it matters or not. I don’t know what ld-up is either. I guess it is an alias for docker compsoe up. The fact that containers start slowly could be caused (and these are guesses not based on experience) by PopOS - Docker Desktop incompatibility or wrong filesystem, wrong qemu-kvm or anything that I can’t think of because I have never seen Docker Desktop container starting for 200 seconds.

Yes, ld-up is an alias for docker-compose up -d apache2 mysql phpmyadmin redis php-worker.

Based on your guesses, do you have a tip on how to check each of the possible causes you mentioned?

I could just check the system logs, run Docker container without compose, run a qemu-kvm VM without Docker.

i can look at your config if you share the output of

docker info

If you can share compose files, that could help too, but if it is related to PopOS that I don’t know, I don’t think I will be able to help.

Docker info

Client:
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.15.1
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.0.5
    Path:     /usr/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.17
    Path:     /usr/lib/docker/cli-plugins/docker-extension
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /usr/lib/docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/lib/docker/cli-plugins/docker-scan

Server:
 Containers: 8
  Running: 8
  Paused: 0
  Stopped: 0
 Images: 8
 Server Version: 20.10.22
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9ba4b250366a5ddde94bb7c9d1def331423aa323
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 7.598GiB
 Name: docker-desktop
 ID: KGXZ:5CPY:PHLA:PDVU:6RT6:QJ5D:CFZB:RVYB:N3GW:3SFY:AL5L:6BOW
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

Logs
https://mega.nz/file/FhBCAJxB#uScNfHlI61ZAystc5wPJfDReSLL9SREtbTrZSeGFHqQ

Laradock repo:
https://github.com/laradock/laradock/blob/master/docker-compose.yml

Do you have enough resources? Have you tried (do you have any way) to test the installation with Docker CE instead of Docker Desktop? You also have proxy urls. I don’t remember if it is normal on Linux or not.

Is the container starting always slow or just the first time? Is there any difference between
Do you always remove (down) the containers or just stop them?

PS: I don’t have time to check the logs

Setup:
Core I5 6600K
32GB RAM DDR4
512GB SSD NVME M2

Docker CE:
I haven’t tested it, but I’ll try it later to see if it makes any difference. Maybe it’s even a good idea, since with the Desktop the PHPStorm terminal doesn’t recognize Docker.

Down: 10s to stop Apache cointainer, other containers 0.1-1.8 seconds
1º UP: 192 seconds
2º UP: 422 seconds
3º UP: 407 seconds

I meant resources inside the virtual machine of Docker Desktop. The amount of memory and CPU can be changed in Docker Desktop for Mac. I don’t remember, but I think it should be there in Docker Desktop for Linux too. It is not available on Windows in case of WSL backend, since WSL is a special virtualization method so it requires configuring WSL directly.

It could be because PHPStorm is looking for the default socket which is created for Docker CE (/var/run/docker.sock). If you don’t have Docker CE installed you can create a symbolic link at /var/run/docker.sock pointing to the socket of Docker Desktop. You can see the path of the socket in the ccntext list

docker context list

Docker Resources:
2 CPU’s
7.8GB Memory
1GB Swap
64 GB Virtual disk limit

I tested PopOS for a few days but I didn’t like it very much, I went back to Mint, and the slowness problem also started to happen in Mint (which before migrating to PopPS, worked perfectly).

I removed Docker Desktop and installed Docker CE and now everything works as it should.