forked from CircleCI-Public/cimg-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
30 lines (21 loc) · 1.23 KB
/
Dockerfile.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# vim:set ft=dockerfile:
# Do not edit individual Dockerfiles manually. Instead, please make changes to the Dockerfile.template, which will be used by the build script to generate Dockerfiles.
# By policy, the base image tag should be a quarterly tag unless there's a
# specific reason to use a different one. This means January, April, July, or
# October.
FROM cimg/%%PARENT%%:2023.04
LABEL maintainer="Community & Partner Engineering Team <[email protected]>"
ENV NODE_VERSION %%VERSION_FULL%%
RUN curl -L -o node.tar.xz "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" && \
sudo tar -xJf node.tar.xz -C /usr/local --strip-components=1 && \
rm node.tar.xz && \
sudo ln -s /usr/local/bin/node /usr/local/bin/nodejs
ENV PATH /home/circleci/.yarn/bin:$PATH
ENV YARN_VERSION 1.22.19
RUN curl -L -o yarn.tar.gz "https://yarnpkg.com/downloads/${YARN_VERSION}/yarn-v${YARN_VERSION}.tar.gz" && \
sudo tar -xzf yarn.tar.gz -C /opt/ && \
rm yarn.tar.gz && \
sudo ln -s /opt/yarn-v${YARN_VERSION}/bin/yarn /usr/local/bin/yarn && \
sudo ln -s /opt/yarn-v${YARN_VERSION}/bin/yarnpkg /usr/local/bin/yarnpkg
# Install an alternative, but growing in popularity Node.js package manager
RUN sudo npm install -g pnpm