-
Notifications
You must be signed in to change notification settings - Fork 309
/
Dockerfile.release
30 lines (24 loc) · 1.45 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
29
30
# TODO(later): llvm-toolchain-16 has been backported to Bullseye with the 11.9 point release –
# switch to using the regular packages instead of LLVM's APT repo here.
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 16
RUN apt-get install -y --no-install-recommends clang-16 lld-16 libunwind-16 libc++abi1-16 libc++1-16 libc++-16-dev libclang-rt-16-dev
COPY . .
RUN echo "build:linux --action_env=CC=/usr/lib/llvm-16/bin/clang --action_env=CXX=/usr/lib/llvm-16/bin/clang++" >> .bazelrc
RUN echo "build:linux --host_action_env=CC=/usr/lib/llvm-16/bin/clang --host_action_env=CXX=/usr/lib/llvm-16/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 bazelisk 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