Last active
February 13, 2021 00:12
-
-
Save pdcastro/5d4d96652181e7da685a32caf629dd44 to your computer and use it in GitHub Desktop.
Dockerfile for "npm install balena-cli" on Ubuntu Bionic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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