Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Postinstall script error: Docker is not running - Mac M1 #336

Open
2 tasks done
ricardobrg opened this issue May 10, 2023 · 7 comments
Open
2 tasks done

Postinstall script error: Docker is not running - Mac M1 #336

ricardobrg opened this issue May 10, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@ricardobrg
Copy link

ricardobrg commented May 10, 2023

Troubleshooting

  • I have attempted to troubleshoot this already

Describe the bug

Running npm install wp-local-docker -g results in the following error

npm ERR! code 1
npm ERR! path /Users/ricardo/.nvm/versions/node/v19.2.0/lib/node_modules/wp-local-docker
npm ERR! command failed
npm ERR! command sh -c npm run 10updocker postinstall --silent
npm ERR! Error : Docker is not running...

If I run the commands separately like in this comment the same error happens in 10updocker create.
Error : Docker is not running...

This is the output of docker info:

Client:
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /Users/ricardo/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.17.3
    Path:     /Users/ricardo/.docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/ricardo/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.19
    Path:     /Users/ricardo/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.4
    Path:     /Users/ricardo/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/ricardo/.docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /Users/ricardo/.docker/cli-plugins/docker-scan
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  v0.10.0
    Path:     /Users/ricardo/.docker/cli-plugins/docker-scout

Server:
 Containers: 4
  Running: 4
  Paused: 0
  Stopped: 0
 Images: 13
 Server Version: 23.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  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 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2806fc1057397dbaeefbea0e4e17bddfbd388f38
 runc version: v1.1.5-0-gf19387a
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 3.841GiB
 Name: docker-desktop
 ID: 66a8ef20-90f1-4c14-a706-8f78baa29874
 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:5555
  127.0.0.0/8
 Live Restore Enabled: false

Steps to Reproduce

1 - Start Docker from the Desktop app.
2 - Open a command line and run npm install wp-local-docker -g

Expected behavior:

10updocker is installed

Current behavior:

Error output:

npm ERR! code 1
npm ERR! path /Users/ricardo/.nvm/versions/node/v19.2.0/lib/node_modules/wp-local-docker
npm ERR! command failed
npm ERR! command sh -c npm run 10updocker postinstall --silent
npm ERR! Error : Docker is not running...

Screenshots, screen recording, code snippet

No response

Environment information

  • Device: MacBook Air M1
  • OS: MacOS Ventura 13.2.1 (22D68)
  • Docker version 23.0.5, build bc4487a
  • npm version 9.6.6
  • node version v19.2.0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ricardobrg ricardobrg added the bug Something isn't working label May 10, 2023
@ricardobrg ricardobrg changed the title Cannot install in Mac M1 - postinstall script error: Docker is not running Postinstall script error: Docker is not running - Mac M1 May 10, 2023
@Freshclicks
Copy link

Freshclicks commented May 20, 2023

I'm experiencing the same issue on my M1 mac. Commenting to subscribe.

@achchu93
Copy link

I got the same issue with M1 chip after updating the Docker to the latest version. But with the Docker Desktop, I could start it manually. Now 10updocker command itself not available.

@glennyabellana
Copy link

Happened on my M1 MBP too after updating Docker Desktop to latest version! I had to downgrade to Docker Desktop version 4.17.0, and it fixed the Error : Docker is not running... issue.

@bjorn2404
Copy link
Member

bjorn2404 commented Jul 27, 2023

Also hitting this on an M2 chip and haven't found a way around it with the latest version. Rolling back to 4.17.0 also worked on my end.

@darylldoyle
Copy link
Collaborator

Hi all 👋

Can you do me a massive favour and check if the following opinion is checked, please:

image

WP Local Docker is still using docker-composer as opposed to the V2 style of docker compose. Enabling this option translates the old V1 version to be V2 compatible. I'm hoping that will help resolve the issue

@edevio
Copy link

edevio commented Nov 6, 2023

I managed to resolve this issue by enabling two settings under Advanced in the Settings. I checked "Allow the default Docker socket to be used" and "Allow privileged port mapping." These settings required a Docker restart.

This fixed previous installs and allowed new site generation. However, for a new site, it did not update my /etc/hosts file. To fix this, I ran sudo vim /etc/hosts and added a new line that matched the hostname entered during the creation prompts, for example, 127.0.0.1 example.test.

System Specifications

  • Apple M1 Max
  • Sonoma 14.0
  • Docker Desktop 4.25.0
    • Engine: 24.0.6
    • Compose: 2.23.0-desktop-1

@marcovega
Copy link

Anyone experiencing this issue on a Debian system (Ubuntu in my case)

sudo ln -s ~/.docker/desktop/docker.sock /var/run/docker.sock

The package looks for the standard location of the docker.sock file, but for Docker Desktop that changed positions a while ago.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants