Create an `rvm` user instead of relying on root for the container.
The `rvm` user has passwordless sudo in the container, so that shouldn't slow anybody down :)
This commit is contained in:
parent
d4f1d9a517
commit
434ee87ad7
|
@ -3,7 +3,12 @@ FROM ubuntu:trusty
|
||||||
# Grab the bare necessities for installing RVM and some Rubies
|
# Grab the bare necessities for installing RVM and some Rubies
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -yq git build-essential curl gnupg && \
|
apt-get install -yq git build-essential curl gnupg && \
|
||||||
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
|
useradd -c "RVM User" -d /home/rvm -G sudo -s /bin/bash -m rvm
|
||||||
|
|
||||||
|
USER rvm
|
||||||
|
|
||||||
|
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
|
||||||
curl -sSL https://get.rvm.io | bash -s stable
|
curl -sSL https://get.rvm.io | bash -s stable
|
||||||
|
|
||||||
COPY rvmrc /root/.rvmrc
|
COPY sudoers /etc/sudoers.d/10-sudo-nopasswd
|
||||||
|
COPY rvmrc /home/rvm/.rvmrc
|
||||||
|
|
|
@ -11,7 +11,7 @@ for RUBY in "${RUBIES[@]}"; do
|
||||||
cat > $DOCKERFILE <<EOF
|
cat > $DOCKERFILE <<EOF
|
||||||
FROM ${IMAGE_TAG}:latest
|
FROM ${IMAGE_TAG}:latest
|
||||||
|
|
||||||
RUN bash -c 'source /usr/local/rvm/scripts/rvm && rvm install ${RUBY}'
|
RUN bash -c 'source ~/.rvm/scripts/rvm && rvm install ${RUBY}'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "> Making ${IMAGE_TAG}:${RUBY}"
|
echo "> Making ${IMAGE_TAG}:${RUBY}"
|
||||||
|
|
Loading…
Reference in New Issue