0

When I run this, the first command works but the command after "&&" is executed on host instead of within container.

docker run -p 7778:7778 -t continuumio/miniconda conda  install -c conda-forge -y jupyter && ipython notebook --ip=* --port=7778

Is there any way to run both the commands within container? I am looking for a way to to do this at command prompt without using script file.

shantanuo
  • 31,689
  • 78
  • 245
  • 403
  • It's sometimes cleaner to mount a bash script as a volume and have your docker command run that script. – C. Reed Aug 14 '16 at 21:19

1 Answers1

1

You can invoke multiple commands via Bash:

docker run -p 7778:7778 -t continuumio/miniconda /bin/bash -c 'conda  install -c conda-forge -y jupyter && ipython notebook --ip=* --port=7778'
Oliver Charlesworth
  • 267,707
  • 33
  • 569
  • 680