Opened 2 years ago
Closed 2 years ago
#56550 closed defect (bug) (fixed)
Failure to run env:start on Linux due to invalid docker-compose argument
Reported by: | westonruter | Owned by: | westonruter |
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | 6.1 |
Component: | Build/Test Tools | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
This is a follow-up to #55700.
In [53895] the docker-compose
command was modified as follows:
-
trunk/tools/local-env/scripts/start.js
a b 10 10 11 11 // Start the local-env containers. 12 execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' } ); 12 const containers = ( process.env.LOCAL_PHP_MEMCACHED === 'true' ) 13 ? 'wordpress-develop memcached' 14 : 'wordpress-develop'; 15 execSync( `docker-compose up -d -- ${containers}`, { stdio: 'inherit' } ); 13 16 14 17 // 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@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@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.
Attachments (1)
Change History (8)
#2
@
2 years ago
- Summary changed from Failure to run env:start on Linux due to invalid docker-compose arguments to Failure to run env:start on Linux due to invalid docker-compose argument
This ticket was mentioned in PR #3291 on WordPress/wordpress-develop by Saggre.
2 years ago
#4
Docker-compose interprets end of options (--) as a service name when running local tools start script.
The hyphens are unnecessary here.
Docs: https://docs.docker.com/engine/reference/commandline/compose_up/
Trac ticket: https://core.trac.wordpress.org/ticket/56550
Note: See
TracTickets for help on using
tickets.
Also happens to me with docker-compose version 1.25.0 from http://archive.ubuntu.com/ubuntu focal/universe