Skip to content

Instantly share code, notes, and snippets.

@osde8info
Forked from pdcastro/Dockerfile
Last active April 13, 2020 18:21
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 osde8info/ad0b54a29af1ab1aa479e489dbad7edc to your computer and use it in GitHub Desktop.
Save osde8info/ad0b54a29af1ab1aa479e489dbad7edc to your computer and use it in GitHub Desktop.
Dockerfile for "npm install balena-cli" on Ubuntu Bionic
#
# Sample Dockerfile for installing balena-cli on Ubuntu Bionic
# Usage:
# $ docker build -t cli-ubuntu .
# $ docker run -it cli-ubuntu
#
# # Then on the container:
# $ which balena
# /usr/local/nvm/versions/node/v10.16.0/bin/balena
# $ balena version
# 11.0.4
#
FROM ubuntu:bionic
# install apt dependencies (no need for Node or npm here)
RUN apt-get update && apt-get install -y curl git python g++ make
# use nvm to install node 8 or node 10 (v10 preferred, v8.16.0 works too)
ENV NODE_VERSION v10.16.0
ENV NVM_DIR /usr/local/nvm
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use $NODE_VERSION"
# install balena-cli
RUN npm install balena-cli -g --production --unsafe-perm
CMD /bin/bash -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment