Skip to content

Commit

Permalink
Merge branch 'main' into type-exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuanwo authored Feb 1, 2023
2 parents 9c2ba52 + 5a7d800 commit 49bbf4f
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
FROM debian:bullseye

ENV TERM xterm-256color

RUN apt-get update -yq && \
apt-get install -yq locales sudo unzip file curl clang openjdk-11-jdk-headless libssl-dev make git ripgrep && \
printf 'en_US.UTF-8 UTF-8\n' > /etc/locale.gen && \
locale-gen && \
rm -rf /var/lib/apt/lists/*

ENV LANGUAGE en_US
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8


RUN groupdel dialout && groupdel staff && \
groupadd -g 20 staff && groupadd -g 121 docker && \
useradd -u 1000 -g 100 builder && \
printf "builder ALL=(ALL:ALL) NOPASSWD:ALL\n" > /etc/sudoers.d/opendal && \
&& chmod 0440 /etc/sudoers.d/builder

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \
rm -rf /root/.cargo/git && \
rm -rf /root/.cargo/registry && \
mkdir -p /opt/rust && \
mv /root/.cargo /opt/rust/cargo && \
mv /root/.rustup /opt/rust/rustup

RUN ln -s $(readlink -f `which javac` | sed "s:/bin/javac::") /opt/java

ENV JAVA_HOME /opt/java
ENV LD_LIBRARY_PATH /opt/java/lib/server
ENV RUSTUP_HOME /opt/rust/rustup
ENV CARGO_HOME /opt/rust/cargo
ENV PATH /opt/rust/cargo/bin:/opt/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

VOLUME [ "/workspace", "/opt/rust/cargo/registry", "/opt/rust/cargo/git" ]

RUN curl -L --output cargo-binstall.tgz https://github.com/cargo-bins/cargo-binstall/releases/download/v0.19.3/cargo-binstall-x86_64-unknown-linux-gnu.tgz && \
tar xf cargo-binstall*.tgz -C /opt/rust/cargo/bin
RUN cargo binstall taplo-cli mdbook lsd --no-confirm

RUN curl -qL https://github.com/rui314/mold/releases/download/v1.2.1/mold-1.2.1-$(uname -m)-linux.tar.gz -o /tmp/mold.tar.gz && \
tar --strip-components=1 -xzf /tmp/mold.tar.gz -C /usr/local && \
rm -rf /tmp/mold.tar.gz && \
ln -sf /usr/local/bin/mold /usr/bin/$(uname -m)-linux-gnu-ld

RUN mkdir /home/builder && chown -R builder /home/builder && \
usermod --shell /bin/bash builder

RUN curl -qL https://github.com/starship/starship/releases/latest/download/starship-$(uname -m)-unknown-linux-musl.tar.gz -o /tmp/starship.tar.gz && \
tar -xzf /tmp/starship.tar.gz -C /usr/local/bin && \
rm -rf /tmp/starship.tar.gz && \
ln -sf /usr/local/bin/starship /usr/bin/starship && \
echo 'eval "$(starship init bash)"' >> /home/builder/.bashrc

USER builder
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "OpenDAL",
"extensions": [
"cschleiden.vscode-github-actions",
"rust-lang.rust-analyzer",
"serayuzgur.crates",
"vadimcn.vscode-lldb"
],
"mounts": [
"source=${localEnv:HOME}/.cargo/registry,target=/opt/rust/cargo/registry,type=bind,consistency=cached",
"source=${localEnv:HOME}/.cargo/git,target=/opt/rust/cargo/git,type=bind,consistency=cached"
],
"dockerFile": "Dockerfile",
"remoteUser": "builder",
"updateRemoteUserUID": true,
"postAttachCommand": "bash",
"settings": {
"editor.formatOnSave": true,
"files.exclude": {
"**/LICENSE": true
}
}
}
2 changes: 2 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ header:
- "**/target/**"
# Ignore test data
- "tests/data"
# Ignore dockerfile
- "**/Dockerfile"

comment: on-failure

1 comment on commit 49bbf4f

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for opendal ready!

✅ Preview
https://opendal-n8cw25xz8-databend.vercel.app
https://opendal-git-type-exercise.vercel.app

Built with commit 49bbf4f.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.