PDMLab / docker-compose

Manage Docker-Compose via Node.js
https://pdmlab.github.io/docker-compose/
MIT License
199 stars 78 forks source link

passing env object causes issues #269

Open alex-Symbroson opened 8 months ago

alex-Symbroson commented 8 months ago

I'm using docker-desktop on windows and having issues when trying to pass an env object to any compose command.\ Happens even if env is just an empty object

Its not a major issue because in my case I can fall back to regular docker commandOptions instead of defining env, but still wanted to let you know.

demo logs:

$ docker [ 'compose', 'up', '-d', 'myservice' ] {
  cwd: 'C:\\path\\to\\compose\\config',
  env: {}
}
E:  myservice:  unknown shorthand flag: 'd' in -d

works with env: undefined:

$ docker [ 'compose', 'up', '-d', 'myservice' ] {
  cwd: 'C:\\path\\to\\compose\\config',
  env: undefined
}
E:  myservice:  Network mynetwork  Creating
E:  myservice:
E:  myservice:  Network mynetwork  Created
E:  myservice:
E:  myservice:  Network mynetwork  Starting
E:  myservice:
E:  myservice:  Network mynetwork  Started
AlexZeitler commented 8 months ago

@alex-Symbroson Thanks for reporting!

Joe-Kollin commented 6 months ago

Getting the same on a LINUX SUSE OS:

export async function up(directory: string): Promise<void> {
  await compose.upAll({ cwd: directory, log: true });
}
exitCode: 125,
 err: "unknown shorthand flag: 'd' in -d\n" +
  "See 'docker --help'.\n" +
  '\n' +
  'Usage:  docker [OPTIONS] COMMAND\n' +
  '\n' +
  'A self-sufficient runtime for containers\n' +
  '\n' +
...