From c4ba99c960e7b9c2195fd330e5465bc562f574f0 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 6 Aug 2021 11:13:52 -0400 Subject: [PATCH] chore: use Docker ENV to set PATH --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index da34581..6fbe10f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,16 +15,13 @@ RUN (yes | unminimize) && \ rm -rf /var/lib/apt/lists/* # Create nodejs user. -RUN adduser --disabled-password --gecos "" nodejs && \ - # Setup ccache for nodejs user. - echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a /home/nodejs/.bashrc +RUN adduser --disabled-password --gecos "" nodejs USER nodejs # Setup npm and install global packages. RUN mkdir ~/.npm-global && \ npm config set prefix '~/.npm-global' && \ - echo 'export PATH="~/.npm-global/bin:$PATH"' | tee -a /home/nodejs/.bashrc && \ npm install -g node-core-utils # Setup Node.js repository @@ -34,6 +31,9 @@ WORKDIR /home/nodejs/node SHELL ["/bin/bash", "-c"] +# Add ccache and npm global packages to PATH +ENV PATH ~/.npm-global/bin:/usr/lib/ccache:$PATH + # Prebuild Node.js RUN source $HOME/.bashrc && \ python configure.py --ninja && ninja -C out/Release -j 2 && \