Skip to content

Commit

Permalink
Ensure npm is available in local and inference Docker images (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
nordzilla authored Nov 5, 2024
1 parent 8170966 commit c48e9d6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@ RUN apt-get update -qq \
python3-pybind11 \
&& apt-get clean

ARG NVM_VERSION=0.40.1
ARG NVM_CHECKSUM=abdb525ee9f5b48b34d8ed9fc67c6013fb0f659712e401ecd88ab989b3af8f53

ARG NODE_VERSION=23.1.0
ARG NODE_CHECKSUM=c438df636858200cffdfc3b579a1d784047da5c0e70dd647616c215726e254e2

ARG NPM_VERSION=10.9.0
ARG NPM_CHECKSUM=8e5f6f3429f8cdbe693cdc29904e9d5a7b127a494bd15c804bd54c7403bfcbe7

RUN curl -o install.sh -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh && \
echo "${NVM_CHECKSUM} install.sh" | sha256sum -c - && \
bash install.sh && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
nvm install ${NODE_VERSION} && \
nvm use ${NODE_VERSION} && \
echo "${NODE_CHECKSUM} $NVM_DIR/versions/node/$(nvm version)/bin/node" | sha256sum -c - && \
echo "${NPM_CHECKSUM} $NVM_DIR/versions/node/$(nvm version)/bin/npm" | sha256sum -c - && \
ln -sf "$NVM_DIR/versions/node/$(nvm version)/bin/node" /usr/local/bin/node && \
ln -sf "$NVM_DIR/versions/node/$(nvm version)/bin/npm" /usr/local/bin/npm && \
rm install.sh

RUN mkdir /builds/worker/tools && \
chown worker:worker /builds/worker/tools && \
mkdir /builds/worker/tools/bin && \
Expand Down
22 changes: 22 additions & 0 deletions taskcluster/docker/inference/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@ RUN apt-get update -qq \
libtool \
&& apt-get clean

ARG NVM_VERSION=0.40.1
ARG NVM_CHECKSUM=abdb525ee9f5b48b34d8ed9fc67c6013fb0f659712e401ecd88ab989b3af8f53

ARG NODE_VERSION=23.1.0
ARG NODE_CHECKSUM=c438df636858200cffdfc3b579a1d784047da5c0e70dd647616c215726e254e2

ARG NPM_VERSION=10.9.0
ARG NPM_CHECKSUM=8e5f6f3429f8cdbe693cdc29904e9d5a7b127a494bd15c804bd54c7403bfcbe7

RUN curl -o install.sh -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh && \
echo "${NVM_CHECKSUM} install.sh" | sha256sum -c - && \
bash install.sh && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
nvm install ${NODE_VERSION} && \
nvm use ${NODE_VERSION} && \
echo "${NODE_CHECKSUM} $NVM_DIR/versions/node/$(nvm version)/bin/node" | sha256sum -c - && \
echo "${NPM_CHECKSUM} $NVM_DIR/versions/node/$(nvm version)/bin/npm" | sha256sum -c - && \
ln -sf "$NVM_DIR/versions/node/$(nvm version)/bin/node" /usr/local/bin/node && \
ln -sf "$NVM_DIR/versions/node/$(nvm version)/bin/npm" /usr/local/bin/npm && \
rm install.sh

RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | apt-key add -
COPY intel-mkl.list /etc/apt/sources.list.d/intel-mkl.list

Expand Down

0 comments on commit c48e9d6

Please sign in to comment.