-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (47 loc) · 1.89 KB
/
Dockerfile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM node:20.18.0-bookworm-slim
ENV LANG C.UTF-8
COPY scripts/build-cdn-assets.sh /usr/local/bin/build-cdn-assets
COPY scripts/build-review-site.sh /usr/local/bin/build-review-site
COPY scripts/copy-npm-config.sh /usr/local/bin/copy-npm-config
COPY scripts/create-hugo-config.sh /usr/local/bin/create-hugo-config
COPY scripts/create-release.sh /usr/local/bin/create-release
COPY scripts/expose-review-site.sh /usr/local/bin/expose-review-site
COPY scripts/lint.sh /usr/local/bin/lint
COPY scripts/serve-review-site.sh /usr/local/bin/serve-review-site
# Build args don't normally persist as environment variables.
ARG AZ_BOOTSTRAP_FROZEN_DIR
ENV AZ_BOOTSTRAP_FROZEN_DIR ${AZ_BOOTSTRAP_FROZEN_DIR:-/azbuild/arizona-bootstrap}
ARG AZ_BOOTSTRAP_SOURCE_DIR
ENV AZ_BOOTSTRAP_SOURCE_DIR ${AZ_BOOTSTRAP_SOURCE_DIR:-/arizona-bootstrap-source}
# Silence warnings from the update-notifier npm package.
ENV NO_UPDATE_NOTIFIER 1
WORKDIR $AZ_BOOTSTRAP_SOURCE_DIR
COPY "package.json" "$AZ_BOOTSTRAP_FROZEN_DIR"/
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
ca-certificates-java \
curl \
git \
jq \
openjdk-17-jre-headless \
rsync \
unzip \
&& rm -rf /var/lib/apt/lists/* \
&& chmod 755 /root \
&& touch /root/.npmrc \
&& chmod 644 /root/.npmrc \
&& npm install --location=global [email protected] \
&& curl 'https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip' -o /tmp/awscliv2.zip \
&& unzip -d /tmp /tmp/awscliv2.zip \
&& /tmp/aws/install \
&& rm /tmp/awscliv2.zip \
&& rm -Rf /tmp/aws
WORKDIR $AZ_BOOTSTRAP_FROZEN_DIR
RUN mkdir /home/node/.npm \
&& chown node:node /home/node/.npm \
&& npm config set cache='/home/node/.npm' \
&& npm install --foreground-scripts=true --loglevel=verbose \
&& find node_modules -name '.DS_Store' -exec rm {} \; \
&& chown -R node:node "$AZ_BOOTSTRAP_FROZEN_DIR"
USER node:node
WORKDIR $AZ_BOOTSTRAP_SOURCE_DIR