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

Docker::Compose::Session#run always requires a command #69

Closed
bilby91 opened this issue Nov 25, 2018 · 2 comments
Closed

Docker::Compose::Session#run always requires a command #69

bilby91 opened this issue Nov 25, 2018 · 2 comments

Comments

@bilby91
Copy link
Contributor

bilby91 commented Nov 25, 2018

docker-compose run service_name can be called without an explicit command. When no command is given, compose will use the command key in the docker-compose specification or default to the CMD in the Dockerfile definition if one was given at build time.

I think that command should be optional but based on how the api works right now, making the command optional will be a breaking change.

Thoughts @xeger ?

@bilby91 bilby91 changed the title Docker::Compose::Session#run always required a command Docker::Compose::Session#run always requires a command Nov 25, 2018
@xeger
Copy link
Owner

xeger commented Nov 27, 2018

Are you sure this isn't supported right now? The method signature uses a position glob *cmd so in theory, it should be legal to pass 0 extra params to Session#run. (You'd still need to provide the service name, but not a command.)

 def run(service, *cmd, ...)

@xeger
Copy link
Owner

xeger commented Feb 22, 2019

Verified that this (should be) supported; there's a unit test case for it:

    it 'runs containers' do
      expect(shell).to receive(:run).with('docker-compose', 'run', {}, 'service1', [])
      session.run('service1')
    end

@xeger xeger closed this as completed Feb 22, 2019
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