mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 20:09:04 +00:00
103 lines
2.6 KiB
Docker
103 lines
2.6 KiB
Docker
# This builds bun in release mode
|
|
FROM ubuntu:20.04
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common
|
|
|
|
RUN add-apt-repository ppa:longsleep/golang-backports
|
|
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
|
|
|
|
RUN wget https://apt.llvm.org/llvm.sh --no-check-certificate
|
|
RUN chmod +x llvm.sh
|
|
RUN ./llvm.sh 12
|
|
|
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
|
ca-certificates \
|
|
curl \
|
|
gnupg2 \
|
|
software-properties-common \
|
|
cmake \
|
|
build-essential \
|
|
git \
|
|
libssl-dev \
|
|
ruby \
|
|
liblld-12-dev \
|
|
libclang-12-dev \
|
|
nodejs \
|
|
gcc \
|
|
g++ \
|
|
npm \
|
|
clang-12 \
|
|
clang-format-12 \
|
|
libc++-12-dev \
|
|
libc++abi-12-dev \
|
|
lld-12 \
|
|
libicu-dev \
|
|
wget \
|
|
unzip \
|
|
tar \
|
|
golang-go chromium-browser ninja-build pkg-config automake autoconf libtool
|
|
|
|
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-12 90 && \
|
|
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-12 90 && \
|
|
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-12 90
|
|
|
|
ENV CC=clang-12
|
|
ENV CXX=clang++-12
|
|
|
|
WORKDIR /home/ubuntu
|
|
ARG BUILDARCH
|
|
ENV ARCH "$BUILDARCH"
|
|
|
|
RUN npm install -g esbuild
|
|
|
|
RUN wget https://github.com/Jarred-Sumner/zig/releases/download/dec20/zig-linux-$BUILDARCH.zip; \
|
|
unzip zig-linux-$BUILDARCH.zip; \
|
|
rm zig-linux-$BUILDARCH.zip;
|
|
|
|
|
|
ENV WEBKIT_OUT_DIR /home/ubuntu/bun-webkit
|
|
|
|
WORKDIR /home/ubuntu
|
|
RUN wget https://github.com/Jarred-Sumner/WebKit/releases/download/Bun-v0/bun-webkit-linux-$BUILDARCH.tar.gz; \
|
|
tar -xzvf bun-webkit-linux-$BUILDARCH.tar.gz; \
|
|
rm bun-webkit-linux-$BUILDARCH.tar.gz && cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null
|
|
|
|
ADD . /home/ubuntu/bun
|
|
|
|
WORKDIR /home/ubuntu
|
|
RUN wget https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz && \
|
|
tar -xzf icu4c-66_1-src.tgz && \
|
|
rm icu4c-66_1-src.tgz && \
|
|
cd icu/source && \
|
|
./configure --enable-static --disable-shared && \
|
|
make -j$(nproc) && \
|
|
make install
|
|
|
|
|
|
ENV PATH "/home/ubuntu/zig:$PATH"
|
|
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR
|
|
ENV LIB_ICU_PATH /home/ubuntu/icu/source/lib
|
|
ENV BUN_RELEASE_DIR /home/ubuntu/bun-release
|
|
|
|
WORKDIR /home/ubuntu/bun
|
|
|
|
RUN mkdir -p $BUN_RELEASE_DIR; \
|
|
make \
|
|
api \
|
|
analytics \
|
|
node-fallbacks \
|
|
runtime_js \
|
|
fallback_decoder \
|
|
bun_error \
|
|
mimalloc \
|
|
zlib \
|
|
libarchive \
|
|
boringssl \
|
|
picohttp \
|
|
jsc-bindings-headers \
|
|
jsc-bindings-mac \
|
|
identifier-cache \
|
|
release \
|
|
copy-to-bun-release-dir
|