aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: ebf579284a934937a7fead1fee1ace6905129115 (plain) (blame)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# 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