[wp-trac] [WordPress Trac] #51898: Docker Env: Check that Docker is running before use

WordPress Trac noreply at wordpress.org
Sun Jan 1 01:36:14 UTC 2023


#51898: Docker Env: Check that Docker is running before use
--------------------------------------+-----------------------
 Reporter:  cnspecialcolor            |       Owner:  mkox
     Type:  defect (bug)              |      Status:  assigned
 Priority:  low                       |   Milestone:  6.2
Component:  Build/Test Tools          |     Version:
 Severity:  minor                     |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:
--------------------------------------+-----------------------

Comment (by bgoewert):

 == Test Report

 Patch tested: [https://github.com/WordPress/wordpress-develop/pull/3810 PR
 3810]

 === Environment
 * OS: Pop!_OS 22.04
 * Docker Desktop v4.15.0 (Docker Engine v20.10.21)

 === Expected Results

 Error saying "Running docker info returned an error. Is docker service and
 server running?"

 === Actual Results

 I get the expected error. ✅

 {{{
 bgoewert at brennans-desktop:~/Projects/WordPress/wordpress-develop$ npm run
 env:start

 > WordPress at 6.2.0 env:start
 > node ./tools/local-env/scripts/start.js

 errors pretty printing info
 /home/bgoewert/Projects/WordPress/wordpress-develop/tools/local-
 env/scripts/start.js:17
                 throw new Error( `Running docker info returned an error.
 Is docker service and server running?` );
                 ^

 Error: Running docker info returned an error. Is docker service and server
 running?
     at Object.<anonymous> (/home/bgoewert/Projects/WordPress/wordpress-
 develop/tools/local-env/scripts/start.js:17:9)
     at Module._compile (node:internal/modules/cjs/loader:1155:14)
     at Object.Module._extensions..js
 (node:internal/modules/cjs/loader:1209:10)
     at Module.load (node:internal/modules/cjs/loader:1033:32)
     at Function.Module._load (node:internal/modules/cjs/loader:868:12)
     at Function.executeUserEntryPoint [as runMain]
 (node:internal/modules/run_main:81:12)
     at node:internal/main/run_main_module:22:47
 }}}

 === Additional Notes
 Before appling the patch, I was getting a different error than the
 reporter.

 {{{
 bgoewert at brennans-desktop:~/Projects/WordPress/wordpress-develop/src$ npm
 run env:start

 > WordPress at 6.2.0 env:start
 > node ./tools/local-env/scripts/start.js

 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the
 docker daemon running?
 node:child_process:935
     throw err;
     ^

 Error: Command failed: docker-compose up -d wordpress-develop
     at checkExecSyncError (node:child_process:861:11)
     at execSync (node:child_process:932:15)
     at Object.<anonymous> (/home/bgoewert/Projects/WordPress/wordpress-
 develop/tools/local-env/scripts/start.js:11:1)
     at Module._compile (node:internal/modules/cjs/loader:1155:14)
     at Object.Module._extensions..js
 (node:internal/modules/cjs/loader:1209:10)
     at Module.load (node:internal/modules/cjs/loader:1033:32)
     at Function.Module._load (node:internal/modules/cjs/loader:868:12)
     at Function.executeUserEntryPoint [as runMain]
 (node:internal/modules/run_main:81:12)
     at node:internal/main/run_main_module:22:47 {
   status: 1,
   signal: null,
   output: [ null, null, null ],
   pid: 157954,
   stdout: null,
   stderr: null
 }
 }}}

 And if I executed `docker info` (before the patch) without Docker Desktop
 running.

 {{{
 bgoewert at brennans-desktop:~/Projects/WordPress/wordpress-develop$ docker
 info
 Client:
  Context:    default
  Debug Mode: false
  Plugins:
   app: Docker App (Docker Inc., v0.9.1-beta3)
   buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
   compose: Docker Compose (Docker Inc., v2.13.0)
   dev: Docker Dev Environments (Docker Inc., v0.0.5)
   extension: Manages Docker extensions (Docker Inc., v0.2.16)
   sbom: View the packaged-based Software Bill Of Materials (SBOM) for an
 image (Anchore Inc., 0.6.0)
   scan: Docker Scan (Docker Inc., v0.22.0)

 Server:
 ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
 Is the docker daemon running?
 errors pretty printing info
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51898#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list