ps doesn't output all services -> offset of 1 service #251
Copy link
Copy link
Open
Description
Hello everyone !
I'm having an issue with ps command. Find below the test code I execute to ps services of a stack of services:
const compose = require('docker-compose')
compose.ps({
cwd: '~/personnal-repo/project/user_id/testkikou', log: false
})
.then((data) => {
console.log(data)
console.log(data.data)
})
.catch((err) => {
console.log(err)
})
And here the output in my console:
{
exitCode: 0,
err: '',
out: 'NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS\n' +
'jupyter-testkikou jupyter/datascience-notebook:latest "tini -g -- start-no…" jupyter-testkikou 30 seconds ago Up 29 seconds (healthy) 8888/tcp\n' +
'nginx-testkikou testkikou-nginx-testkikou "/docker-entrypoint.…" nginx-testkikou About an hour ago Restarting (1) 49 seconds ago \n' +
'vscode-testkikou lscr.io/linuxserver/code-server "/init" vscode-testkikou 32 minutes ago Up 32 minutes 8443/tcp\n',
data: { services: [ [Object], [Object] ] }
}
{
services: [
{
name: 'nginx-testkikou',
command: 'testkikou-nginx-testkikou',
state: '"/docker-entrypoint.…"',
ports: [Array]
},
{
name: 'vscode-testkikou',
command: 'lscr.io/linuxserver/code-server',
state: '"/init"',
ports: [Array]
}
]
}
As you can see, in the first part of the log we see three services (those are running), and in the second part (second console.log) we see the services object returned by the package.
If I stop one service from the stack, it shows 1 service in the service object.
I don't know if the issue comes from me with my. bad usage or from a regression of the package. Your help is appreciated !
Thanks in advance 👍
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
AlexZeitler commentedon Sep 1, 2023
@FredPi17 which version of the
docker-composenpm package and which version of thedocker-composeCLI do you use? From yourrequirestatement I can guess you're using v1 of the CLI, right?Please post the output of
docker-compose --version