Search code examples
linuxwordpressdocker-composearm64

wp-env spawn docker-compose ENOENT on Raspberry Pi OS arm64


When try to execute

$ wp-env start

This is the error

⚠ Warning: could not find a .wp-env.json configuration file and could not determine if '/home/salsan/Projects/Wordpress' is a WordPress installation, a plugin, or a theme.
✖ spawn docker-compose ENOENT
Error: spawn docker-compose ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn docker-compose',
  path: 'docker-compose',
  spawnargs: [
    '-f',
    '/home/salsan/.wp-env/8a634c95f96354e6faf10a0a35376956/docker-compose.yml',
    'down'
  ]
}

I read from Github issues for solve this problem, Enable Docker Compose V1/V2 compatibility mode in the Settings section of Docker Desktop , but on Raspberry Pi OS I don't have docker-desktop, if is this the problem how to solve it ?

My environment

Operating System: Debian GNU/Linux 11 (bullseye)

Kernel: Linux 5.15.84-v8+

Architecture: arm64

nvm 0.39.1 Node Version Manager

node v18.14.2

wp-env 5.13.0 ( globally installation )

Docker version 23.0.1, build a5ee5b1

I found this discussion on Stackoverflow , I added this line

alias docker-compose="docker compose --compatibility $@"

on .bashrc and .profile but problem is still present


Solution

  • I found from same discussion this workaround

    # touch /bin/docker-compose
    # echo 'docker compose --compatibility "$@"' > /bin/docker-compose
    # chmod +x /bin/docker-compose