dockerfile - Some RUNs won't work on docker but will when inside a container -


i've got dockerfile lua , torch related tasks , i'm trying install rocks using luarocks.

from ubuntu:14.04 run rm /bin/sh && ln -s /bin/bash /bin/sh  run apt-get update -y run apt-get install -y curl git  run curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash run git clone https://github.com/torch/distro.git ~/torch --recursive run cd ~/torch; ./install.sh  run source ~/.bashrc  run luarocks install nngraph run luarocks install optim run luarocks install nn  run luarocks install cltorch run luarocks install clnn 

docker build runs fine until first luarocks call: run luarocks install nngraph @ point stops , throws error:

/bin/sh: luarocks: command not found 

if comment out luarocks lines, build runs fine. using image, can create container , using bash, run luarocks expected.

of course, don't particularly want have every time start container, i'm wondering if there's can make work. have feeling problem has line run rm /bin/sh && ln -s /bin/bash /bin/sh need able run line run source ~/.bashrc.

thanks.

each run command runs on own shell , new layer committed.

from docker documentations:

run (the command run in shell - /bin/sh -c - shell form)

so when run luarocks install <app> not same shell source profile.

you have provide full path luarocks run. see below modified dockerfile run:

from ubuntu:14.04 run rm /bin/sh && ln -s /bin/bash /bin/sh  run apt-get update -y run apt-get install -y curl git  run curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash run git clone https://github.com/torch/distro.git ~/torch --recursive run cd ~/torch; ./install.sh  run source ~/.bashrc  run /root/torch/install/bin/luarocks install nngraph run /root/torch/install/bin/luarocks install optim run /root/torch/install/bin/luarocks install nn run /root/torch/install/bin/luarocks install cltorch run /root/torch/install/bin/luarocks install clnn 

for more details see docker run documentation here.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -