Skip to content

Instantly share code, notes, and snippets.

@pdcastro
Last active February 13, 2021 00:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pdcastro/5d4d96652181e7da685a32caf629dd44 to your computer and use it in GitHub Desktop.
Save pdcastro/5d4d96652181e7da685a32caf629dd44 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 .
# $ docker run -it --privileged --network host -v /var/run/docker.sock:/var/run/docker.sock cli
FROM ubuntu:18.04
# install dependencies - don't install nodejs or npm via apt-get!
RUN apt-get update && apt-get install -y curl git python g++ make
ENV NODE_VERSION v12.20.2
ENV NVM_DIR /usr/local/nvm
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
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