[wp-trac] [WordPress Trac] #56550: Failure to run env:start on Linux due to invalid docker-compose arguments

WordPress Trac noreply at wordpress.org
Sun Sep 11 21:00:02 UTC 2022


#56550: Failure to run env:start on Linux due to invalid docker-compose arguments
------------------------------+--------------------
 Reporter:  westonruter       |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  6.1
Component:  Build/Test Tools  |    Version:  trunk
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+--------------------
 This is a follow-up to #55700.

 In [53895] the `docker-compose` command was modified as follows:

 {{{#!diff
 Index: trunk/tools/local-env/scripts/start.js
 ===================================================================
 --- a/trunk/tools/local-env/scripts/start.js
 +++ b/trunk/tools/local-env/scripts/start.js
 @@ -10,5 +10,8 @@

  // Start the local-env containers.
 -execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' }
 );
 +const containers = ( process.env.LOCAL_PHP_MEMCACHED === 'true' )
 +    ? 'wordpress-develop memcached'
 +    : 'wordpress-develop';
 +execSync( `docker-compose up -d -- ${containers}`, { stdio: 'inherit' }
 );

  // If Docker Toolbox is being used, we need to manually forward
 LOCAL_PORT to the Docker VM.
 }}}

 The inclusion of `--` before the list of containers is causing the
 `env:start` command to fail on Linux, at least in `docker-compose`
 v1.25.0. I get an error:

 {{{
 $ npm run env:start

 > WordPress at 6.1.0 env:start /home/westonruter/repos/wordpress-develop
 > node ./tools/local-env/scripts/start.js

 Creating network "wordpress-develop_wpdevnet" with driver "bridge"
 ERROR: No such service: --
 child_process.js:866
     throw err;
     ^

 Error: Command failed: docker-compose up -d -- wordpress-develop
     at checkExecSyncError (child_process.js:790:11)
     at execSync (child_process.js:863:15)
     at Object.<anonymous> (/home/westonruter/repos/wordpress-develop/tools
 /local-env/scripts/start.js:11:1)
     at Module._compile (internal/modules/cjs/loader.js:1085:14)
     at Object.Module._extensions..js
 (internal/modules/cjs/loader.js:1114:10)
     at Module.load (internal/modules/cjs/loader.js:950:32)
     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
     at Function.executeUserEntryPoint [as runMain]
 (internal/modules/run_main.js:75:12)
     at internal/main/run_main_module.js:17:47 {
   status: 1,
   signal: null,
   output: [ null, null, null ],
   pid: 8626,
   stdout: null,
   stderr: null
 }
 npm ERR! code ELIFECYCLE
 npm ERR! errno 1
 npm ERR! WordPress at 6.1.0 env:start: `node ./tools/local-
 env/scripts/start.js`
 npm ERR! Exit status 1
 }}}

 If I remove the `--` then the command runs successfully.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56550>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list