improvements to ruby gem installation

This commit is contained in:
Adam Brown 2015-02-15 15:15:48 -05:00
parent 97d5f59c3f
commit 4470b9caef
3 changed files with 29 additions and 7 deletions

View File

@ -15,26 +15,30 @@ RUN apt-get -y update && apt-get -y install \
RUN curl -sL https://deb.nodesource.com/setup | bash - RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get install -y nodejs RUN apt-get install -y nodejs
# install ruby and the SASS rubygem # install ruby
RUN apt-get install -y ruby RUN apt-get install -y ruby1.9.1 ruby1.9.1-dev
RUN gem install sass
# add a user # add a user
RUN useradd -ms /bin/bash docker RUN useradd -ms /bin/bash docker
# switch to the docker user # switch to the docker user
ENV HOME /home/docker ENV HOME /home/docker
USER docker USER docker
# configure ruby gems to run from the home directory
ENV PATH $PATH:/home/docker/.gem/ruby/1.9.1/bin
# install some ruby gems
RUN gem install --user-install sass
RUN gem install --user-install compass
# configure npm to run without sudo permissions # configure npm to run without sudo permissions
RUN echo 'prefix=${HOME}/.npm-packages' >> $HOME/.npmrc RUN echo 'prefix=${HOME}/.npm-packages' >> $HOME/.npmrc
ENV NPM_PACKAGES $HOME/.npm-packages ENV NPM_PACKAGES $HOME/.npm-packages
ENV NODE_PATH $NPM_PACKAGES/lib/node_modules:$NODE_PATH ENV NODE_PATH $NPM_PACKAGES/lib/node_modules:$NODE_PATH
ENV PATH $NPM_PACKAGES/bin:$PATH ENV PATH $PATH:$NPM_PACKAGES/bin
ENV MANPATH $NPM_PACKAGES/share/man:$(manpath) ENV MANPATH $(manpath):$NPM_PACKAGES/share/man
# install yeoman tooling and other npm packages # install yeoman tooling and other npm packages
RUN npm install -g node-gyp RUN npm install -g node-gyp

14
mount-data Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# determine the id of the user who invoked this script
# if sudo was used, the user who invoked sudo
if [ ${SUDO_USER} ]
then
REAL_USER=${SUDO_USER}
else
REAL_USER=${USER}
fi
echo "mounting //localhost_data to /mnt/data with uid:gid ${REAL_USER}:${REAL_USER}"
mount -t cifs //localhost/_data /mnt/data -o uid=${REAL_USER} -o gid=${REAL_USER} -o forceuid -o forcegid

View File

@ -91,3 +91,7 @@ echo "> sudo docker run --volumes-from=data-files --rm -it adamarthurryan/mean-d
echo echo
echo "* or maybe you want another dev server:" echo "* or maybe you want another dev server:"
echo "docker run -d --name=thename --volumes-from=data-files --link=mongodb:mongodb -p=localnum:9000 -p=localnum:34729 -it adamarthurryan/mean-dev" echo "docker run -d --name=thename --volumes-from=data-files --link=mongodb:mongodb -p=localnum:9000 -p=localnum:34729 -it adamarthurryan/mean-dev"
echo
echo "* mount the data folder with ./mount-data"