Public Repository

Last pushed: 6 months ago
Short Description
nenv a tool for managing node.js versions
Full Description

Build

docker build -t nenv .

You can build custom versions of this image with specific version of node.js installed by default using the following build command:

docker build --build-args NODE_VERSION=version -t nenv:version .

Supported tags

  • latest: nenv only no node.js installed by default
  • 6.9.5: nenv with node.js 6.9.5 installed by default

Dockerfile

FROM ubuntu:latest

ENV HOME /root

WORKDIR $HOME

# Add apt repository needed
RUN echo 'deb http://archive.ubuntu.com/ubuntu xenial main universe' > /etc/apt/sources.list  && \
    echo 'deb http://archive.ubuntu.com/ubuntu xenial-security main universe' >> /etc/apt/sources.list && \
    echo 'deb http://archive.ubuntu.com/ubuntu xenial-updates main universe' >> /etc/apt/sources.list && \
    echo 'deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse' >> /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial main universe' >> /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial-security main universe' >> /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial-updates main universe' >> /etc/apt/sources.list && \
    echo 'deb-src http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse' >> /etc/apt/sources.list && \
    apt-get update && \
    apt-get install -y --no-install-recommends \
      ca-certificates \
      fakeroot \
      software-properties-common \
      build-essential \
      git \
      curl \
      wget \
      python && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install nenv
RUN git clone https://github.com/ryuone/nenv.git $HOME/.nenv && \
    echo 'eval "$(nenv init -)"' >> /etc/profile.d/nenv.sh && \
    echo 'eval "$(nenv init -)"' >> $HOME/.bashrc

ENV PATH $HOME/.nenv/bin:$HOME/.nenv/shims:$PATH

# Install node version if specified
ARG NODE_VERSION

RUN if [ ${NODE_VERSION} ]; then $HOME/.nenv/bin/nenv install $NODE_VERSION && $HOME/.nenv/bin/nenv global $NODE_VERSION; fi
Docker Pull Command
Owner
quasipresence

Comments (0)