repo2docker icon indicating copy to clipboard operation
repo2docker copied to clipboard

Specifying multiple commands when launching a container from the CLI

Open betatim opened this issue 6 years ago • 2 comments

I was expecting to be able to run several commands as the command repo2docker runs but can't work out how.

Something like repo2docker https://github.com/binder-examples/conda-freeze conda install numpy pandas && conda env export -n root is what I'd like to do. If you quote the command like so repo2docker https://github.com/binder-examples/conda-freeze "conda install numpy pandas && conda env export -n root" you get a "command not found' error.

The more complicated repo2docker https://github.com/binder-examples/conda-freeze /bin/sh -c 'conda install -y numpy && conda env export -n root' does work.

I think this is related to #599 and how we pass the command to dockerd/not using a shell to run the command.

betatim avatar Mar 02 '19 07:03 betatim

I think explicitly invoking the shell us the right thing to do. && Is a shell feature, not inherent to starting processes in Linux.

We could launch with a shell by default but that has negatives - AFAIK /bin/sh eats signals without propagating them. We should definitely document this pattern though

yuvipanda avatar May 21 '19 08:05 yuvipanda

@betatim Do you still want this?

manics avatar May 17 '21 20:05 manics