From 8de5399818a065f3eb2e5834dd89c1a1bcb8c70d Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 3 Oct 2021 05:37:16 -0700 Subject: [PATCH] fix(Docker): Fixing broken Docker file --- docker/mainnet/Dockerfile | 41 +++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/docker/mainnet/Dockerfile b/docker/mainnet/Dockerfile index fd17890..b3de86a 100644 --- a/docker/mainnet/Dockerfile +++ b/docker/mainnet/Dockerfile @@ -1,19 +1,48 @@ -FROM christroutner/ct-base-ubuntu +FROM ubuntu:20.04 MAINTAINER Chris Troutner -RUN apt-get update -y +#Update the OS and install any OS packages needed. +RUN apt-get update +RUN apt-get install -y sudo git curl nano gnupg wget + +#Install Node and NPM +RUN curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh +RUN bash nodesource_setup.sh +RUN apt-get install -y nodejs build-essential + +#Create the user 'safeuser' and add them to the sudo group. +RUN useradd -ms /bin/bash safeuser +RUN adduser safeuser sudo + +#Set password to 'abcd8765' change value below if you want a different password +RUN echo safeuser:abcd8765 | chpasswd + +#Set the working directory to be the users home directory +WORKDIR /home/safeuser + +#Setup NPM for non-root global install (like on a mac) +RUN mkdir /home/safeuser/.npm-global +RUN chown -R safeuser .npm-global +RUN echo "export PATH=~/.npm-global/bin:$PATH" >> /home/safeuser/.profile +RUN runuser -l safeuser -c "npm config set prefix '~/.npm-global'" + +# Update to the latest version of npm. +# Working with npm@7.21.1 +RUN npm install -g npm + +#FROM christroutner/ct-base-ubuntu +#MAINTAINER Chris Troutner + +#RUN apt-get update -y #Set the working directory to be the home directory -WORKDIR /home/safeuser +#WORKDIR /home/safeuser # Switch to user account. USER safeuser # Prep 'sudo' commands. #RUN echo 'abcd8765' | sudo -S pwd -# Install Redis. TODO: Make this a separate container. - - # Clone the repository WORKDIR /home/safeuser RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api