I'm trying to sudo for a node install:
sudo npm install -g grunt
sudo npm install -g grunt-cli
sudo npm install -g bower
The commands error stating to run as an administrative user. How do I do that in the Dockerfile?
RUN npm install -g grunt
#RUN ln -s /home/dev/spikes/node-esjs-master/node_modules/grunt /usr/bin/grunt
RUN npm install -g grunt-cli
#RUN ln -s /home/dev/spikes/node-esjs-master/node_modules/grunt-cli /usr/bin/grunt-cli
RUN npm install -g bower
#RUN ln -s /home/dev/spikes/node-esjs-master/node_modules/bower /usr/bin/bower
I don't actually try to sudo in the docker commands...I have after connecting to the container but when prompted for the password I don't know it. I tried to create a sym link but couldn't get that to work. My apologies if this is basic in nature - new environments for me :-).
Thanks!
You don't need to use sudo because all commands in the dockerfile are executed as root. A sample Dockerfile to install those software (Ubuntu Thrusty as base):
FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y nodejs npm
RUN npm install -g grunt
RUN npm install -g grunt-cli
RUN npm install -g bower
The same applies for the run command:
$ sudo docker run my_awesome_image whoami
root