Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use Docker ENV to set PATH #1

Merged
merged 1 commit into from
Aug 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 && \
Expand Down