Skip to content

Instantly share code, notes, and snippets.

@deepak
Created July 5, 2013 10:11
Show Gist options
  • Select an option

  • Save deepak/5933546 to your computer and use it in GitHub Desktop.

Select an option

Save deepak/5933546 to your computer and use it in GitHub Desktop.
PATH cannot be interpolated in ENV
# DOCKER-VERSION 0.4.8
FROM ubuntu:12.04
# install essentials
RUN apt-get install -y -q git
# Install rbenv
RUN git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
RUN echo '# rbenv setup' > /etc/profile.d/rbenv.sh
RUN echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
RUN echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
RUN echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
RUN chmod +x /etc/profile.d/rbenv.sh
# install ruby-build
RUN mkdir /usr/local/rbenv/plugins
RUN git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
ENV RBENV_ROOT /usr/local/rbenv
ENV PATH "$RBENV_ROOT/bin:$RBENV_ROOT/shims:$PATH"
# does not work. PATH is set to
# $RBENV_ROOT/shims:$RBENV_ROOT/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
@deepak
Copy link
Author

deepak commented Jul 5, 2013

steps to reproduce:

cat Dockerfile.badruby | docker build -t deepak/badruby -

docker run -t deepak/badruby /bin/bash -l -c "echo $PATH"
2013/07/05 10:15:50 Unable to set up networking: command not found: ip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment