-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate Dockerfile for devcontainer
- Loading branch information
1 parent
4b5e7cd
commit c772256
Showing
2 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
FROM ubuntu:20.04 as bun.devcontainer | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG GITHUB_WORKSPACE=/build | ||
ARG BUILDARCH=amd64 | ||
|
||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig | ||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit | ||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release | ||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps | ||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun | ||
ENV WEBKIT_OUT_DIR ${WEBKIT_DIR} | ||
ENV PATH "$ZIG_PATH:$PATH" | ||
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR | ||
ENV LIB_ICU_PATH ${GITHUB_WORKSPACE}/icu/source/lib | ||
ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR} | ||
ENV PATH "${GITHUB_WORKSPACE}/packages/bun-linux-x64:${GITHUB_WORKSPACE}/packages/bun-linux-aarch64:${GITHUB_WORKSPACE}/packages/debug-bun-linux-x64:${GITHUB_WORKSPACE}/packages/debug-bun-linux-aarch64:$PATH" | ||
ENV PATH "/home/ubuntu/zls/zig-out/bin:$PATH" | ||
ENV BUN_INSTALL /home/ubuntu/.bun | ||
ENV XDG_CONFIG_HOME /home/ubuntu/.config | ||
|
||
WORKDIR ${GITHUB_WORKSPACE} | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common && \ | ||
add-apt-repository ppa:longsleep/golang-backports && \ | ||
wget https://apt.llvm.org/llvm.sh --no-check-certificate && \ | ||
chmod +x llvm.sh && \ | ||
./llvm.sh 13 && \ | ||
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \ | ||
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-13-dev \ | ||
libclang-13-dev \ | ||
nodejs \ | ||
gcc \ | ||
g++ \ | ||
clang-13 \ | ||
clang-format-13 \ | ||
libc++-13-dev \ | ||
libc++abi-13-dev \ | ||
lld-13 \ | ||
libicu-dev \ | ||
wget \ | ||
rustc \ | ||
cargo \ | ||
unzip \ | ||
tar \ | ||
golang-go ninja-build pkg-config automake autoconf libtool curl && \ | ||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-13 90 && \ | ||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-13 90 && \ | ||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-13 90 && \ | ||
npm install -g esbuild | ||
|
||
ENV CC=clang-13 | ||
ENV CXX=clang++-13 | ||
ENV ZIG "${ZIG_PATH}/zig" | ||
ARG BUILDARCH=amd64 | ||
|
||
|
||
WORKDIR $GITHUB_WORKSPACE | ||
|
||
RUN cd / && mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR ${BUN_DIR} ${BUN_DEPS_OUT_DIR} | ||
|
||
WORKDIR $GITHUB_WORKSPACE | ||
|
||
RUN cd $GITHUB_WORKSPACE && \ | ||
curl -o zig-linux-$BUILDARCH.zip -L https://github.com/Jarred-Sumner/zig/releases/download/jul1/zig-linux-$BUILDARCH.zip && \ | ||
unzip -q zig-linux-$BUILDARCH.zip && \ | ||
rm zig-linux-$BUILDARCH.zip; | ||
|
||
RUN cd $GITHUB_WORKSPACE && \ | ||
curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/Jarred-Sumner/WebKit/releases/download/jul4/bun-webkit-linux-$BUILDARCH.tar.gz && \ | ||
tar -xzf bun-webkit-linux-$BUILDARCH.tar.gz && \ | ||
rm bun-webkit-linux-$BUILDARCH.tar.gz && \ | ||
cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null | ||
|
||
RUN apt-get -y update && update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-13 90 | ||
|
||
COPY .devcontainer/workspace.code-workspace $GITHUB_WORKSPACE/workspace.code-workspace | ||
COPY .devcontainer/zls.json $GITHUB_WORKSPACE/workspace.code-workspace | ||
COPY .devcontainer/limits.conf /etc/security/limits.conf | ||
COPY ".devcontainer/scripts/" /scripts/ | ||
COPY ".devcontainer/scripts/getting-started.sh" $GITHUB_WORKSPACE/getting-started.sh | ||
RUN mkdir -p /home/ubuntu/.bun /home/ubuntu/.config $GITHUB_WORKSPACE/bun && \ | ||
bash /scripts/common-debian.sh && \ | ||
bash /scripts/github.sh && \ | ||
bash /scripts/nice.sh && \ | ||
bash /scripts/zig-env.sh | ||
COPY .devcontainer/zls.json /home/ubuntu/.config/zls.json |