Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ps doesn't output all services -> offset of 1 service #251

Open
FredPi17 opened this issue Aug 31, 2023 · 1 comment
Open

ps doesn't output all services -> offset of 1 service #251

FredPi17 opened this issue Aug 31, 2023 · 1 comment

Comments

@FredPi17
Copy link

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 👍

@AlexZeitler
Copy link
Contributor

@FredPi17 which version of the docker-compose npm package and which version of the docker-compose CLI do you use? From your require statement I can guess you're using v1 of the CLI, right?

Please post the output of docker-compose --version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants