-
Notifications
You must be signed in to change notification settings - Fork 358
/
Copy pathDockerfile.release
28 lines (22 loc) · 1.18 KB
/
Dockerfile.release
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
FROM node:bullseye AS builder
WORKDIR /workerd
# Replacing build-essential with dpkg-dev here, no need to install gcc.
RUN apt-get update
RUN apt-get install -y --no-install-recommends curl dpkg-dev git lsb-release wget software-properties-common gnupg tcl
RUN wget https://apt.llvm.org/llvm.sh
# Drop the install step here so we can install just the packages we need.
RUN sed -i '/apt-get install/d' llvm.sh
RUN chmod +x llvm.sh
RUN ./llvm.sh 18
RUN apt-get install -y --no-install-recommends clang-18 lld-18 libunwind-18 libc++abi1-18 libc++1-18 libc++-18-dev libclang-rt-18-dev
COPY . .
RUN echo "build:linux --action_env=CC=/usr/lib/llvm-18/bin/clang" >> .bazelrc
RUN echo "build:linux --host_action_env=CC=/usr/lib/llvm-18/bin/clang" >> .bazelrc
COPY .bazel-cache /bazel-disk-cache
# pnpm version will be different depending on the value of `packageManager` field in package.json
RUN npm install -g pnpm@latest
RUN pnpm install
RUN pnpm exec bazel build --disk_cache=/bazel-disk-cache --config=release_linux //src/workerd/server:workerd
FROM scratch as artifact
COPY --from=builder /workerd/bazel-bin/src/workerd/server/workerd /workerd-linux-arm64
COPY --from=builder /bazel-disk-cache /.bazel-cache