Skip to content

Commit

Permalink
feat: add alternative images and download links
Browse files Browse the repository at this point in the history
Signed-off-by: Yiyang Wu <[email protected]>
  • Loading branch information
ToolmanP committed Oct 12, 2024
1 parent 520efc2 commit 6bb20b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 68 deletions.
67 changes: 1 addition & 66 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,72 +1,7 @@
FROM ipads/chcore_builder:v1.9.0
FROM ipads/oslab:24.09

ARG USERNAME=stu
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN sed -i "s/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y sudo \
binutils-dev \
libgmp-dev \
libmpfr-dev \
curl \
meson \
python3 \
python3-pip \
python3-psutil \
bear \
cmake \
git \
pkgconf \
clangd

# We need to install a latest gdb to support cppdbg.
RUN curl -SLO https://ftp.gnu.org/gnu/gdb/gdb-13.2.tar.xz && \
tar -xf gdb-13.2.tar.xz && \
cd gdb-13.2 && \
./configure --prefix=/usr/local \
--enable-targets=aarch64-linux-gnu,x86_64-linux-gnu \
--enable-tui \
--disable-sim \
&& \
make -j$(nproc) && \
make install && \
cd .. && \
rm -rf gdb-13.2 gdb-13.2.tar.xz

# install tomli for .toml file required by qemu 9.1.x
RUN pip install tomli

# we need to install >=glib-2.66.8 to support qemu 9.1.x
RUN curl -SLO https://download.gnome.org/sources/glib/2.66/glib-2.66.8.tar.xz && \
tar -xvf glib-2.66.8.tar.xz && \
cd glib-2.66.8 && \
meson build --prefix /usr/local && \
ninja -C build && \
ninja -C build install && \
cd .. && \
rm -rf glib-2.66.8 glib-2.66.8.tar.xz

# install latest supported qemu supported by ubuntu-20.04.
RUN curl -SLO https://download.qemu.org/qemu-9.1.0.tar.xz && \
tar -xf qemu-9.1.0.tar.xz && \
cd qemu-9.1.0 && \
./configure --prefix=/usr/local \
--target-list=aarch64-softmmu,aarch64-linux-user && \
make -j$(nproc) && \
make install && \
cd .. && \
rm -rf qemu-9.1.0 qemu-9.1.0.tar.xz

RUN apt-get install -y libglib2.0-dev
RUN apt-get clean

# install repo
RUN curl -SL https://storage.googleapis.com/git-repo-downloads/repo -o /usr/local/bin/repo && \
chmod +x /usr/local/bin/repo
RUN useradd -m -u $USER_UID -U -s /bin/bash stu
RUN usermod -aG sudo stu
RUN passwd -d stu
USER $USERNAME
CMD ["/bin/bash"]
11 changes: 10 additions & 1 deletion Pages/Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@
请按照Docker官方指示为你运行的操作系统安装对应的Docker发行版。

> [!IMPORTANT] 关于Docker
> 由于中国大陆地区的网络限制,请确保你的docker能够连接到docker-hub,测试方法可以使用 `docker pull nginx:latest`,如果无法访问,您可以依照[该文档](https://docs.docker.com/engine/daemon/)为你的docker daemon添加代理规则。
> 由于中国大陆地区的网络限制,请确保你的docker能够连接到docker-hub,测试方法可以使用 `docker pull nginx:latest`,如果无法访问,您可以依照[该文档](https://docs.docker.com/engine/daemon/)为你的docker daemon添加代理规则。
> 如果你缺少代理,你可以使用这个[链接(提取uwuv)](https://pan.baidu.com/s/1ipbMZ-C1Qk0S9PGDDMMy6w)下载压缩好的Docker镜像,镜像使用`zstd`进行压缩。你可以使用以下的命令解压后,再使用`docker`进行导入。
>
> ```
> zstd -d docker.ipads.oslab.yy.mm.tar.zstd
> docker load -i docker.ipads.oslab.yy.mm.tar
> ```
> [!IMPORTANT] 关于虚拟机
> 如果你使用的是Windows/MacOS系统,如果不想手动安装docker以及下载镜像,我们也准备了基于VMWare 17的虚拟机镜像,你可以在这个[链接(提取uwuv)](https://pan.baidu.com/s/1ipbMZ-C1Qk0S9PGDDMMy6w)找到,你可以在解压之后导入vmware即可使用。用户stu 密码为123456
### 使用Dev-Container (推荐)
Expand Down
2 changes: 1 addition & 1 deletion Scripts/chbuild
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ _docker_run() {
-u $(id -u ${USER}):$(id -g ${USER}) \
-v ${LABROOT}:${LABROOT} -w $(pwd) \
--security-opt=seccomp:unconfined \
ipads/chcore_builder:v1.9.0 \
ipads/oslab:24.09 \
$self $@
fi
}
Expand Down

0 comments on commit 6bb20b9

Please sign in to comment.