Skip to content

Instantly share code, notes, and snippets.

@f440
Last active January 4, 2018 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f440/4a5e7205fd5d8fd1e794a4a552342825 to your computer and use it in GitHub Desktop.
Save f440/4a5e7205fd5d8fd1e794a4a552342825 to your computer and use it in GitHub Desktop.
use_node doesn't work at all #319 https://github.com/direnv/direnv/issues/319
FROM ubuntu:16.04
RUN apt-get update \
&& apt-get install -y git curl
# RUN apt-get install -y curl
RUN curl -o - https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
RUN curl -L -o direnv https://github.com/direnv/direnv/releases/download/v2.14.0/direnv.linux-amd64
RUN install direnv /usr/local/bin/
RUN echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
RUN . ~/.bashrc && nvm install 8.9.1
SHELL ["/bin/bash", "-l", "-c"]
RUN mkdir -p /app \
&& echo -e '\
set -x\n\
export NODE_VERSIONS=$HOME/.nvm/versions/node/ \n\
export NODE_VERSION_PREFIX=v \n\
use node 8.9.1 \n\
set +x\n' > /app/.envrc
RUN cd /app || true \
&& direnv allow
CMD cd /app && direnv reload \
&& echo "================================================================" \
&& echo "bash version: $(bash --version)" \
&& echo "================================================================" \
&& echo "node version: $(node --version)" \
&& set \
&& echo "================================================================"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment