| Dockerfile | Usage | Docker Hub Image |
|---|---|---|
| riscv-vm.dockerfile | Deploy OpenEuler 24.03 (RV64) on QEMU 9.2.3 | yuxuanz19/riscv-vm |
| plt-miktex.dockerfile | Use matplotlib along with LaTeX (miktex) | yuxuanz19/plt-miktex |
Last active
September 21, 2025 06:38
-
-
Save yuxuan-z19/6a1d0f5b947167e5bd0010af1bc4fa38 to your computer and use it in GitHub Desktop.
# My Dockerfiles
This file contains hidden or 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 hidden or 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
| FROM ubuntu:jammy | |
| RUN sed -E -i "s/(archive|security).ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \ | |
| apt update && \ | |
| DEBIAN_FRONTEND=noninteractive apt install -y \ | |
| tzdata curl wget ca-certificates gnupg lsb-release \ | |
| build-essential pkg-config git fonts-dejavu-core && \ | |
| rm -rf /var/lib/apt/lists/* | |
| ENV TERM=xterm-256color | |
| ENV TZ=Asia/Shanghai | |
| # uv | |
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \ | |
| mkdir -p ~/.config/uv && \ | |
| echo '[[index]]' > ~/.config/uv/uv.toml && \ | |
| echo 'url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"' >> ~/.config/uv/uv.toml && \ | |
| echo 'default = true' >> ~/.config/uv/uv.toml | |
| ENV PATH="/root/.local/bin:${PATH}" | |
| # MiKTeX + Times New Roman | |
| RUN curl -fsSL https://miktex.org/download/key | gpg --dearmor -o /usr/share/keyrings/miktex.gpg && \ | |
| echo "deb [signed-by=/usr/share/keyrings/miktex.gpg] https://miktex.org/download/ubuntu jammy universe" > /etc/apt/sources.list.d/miktex.list && \ | |
| apt update && \ | |
| echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ | |
| DEBIAN_FRONTEND=noninteractive apt install -y miktex ttf-mscorefonts-installer && \ | |
| miktexsetup finish && \ | |
| initexmf --set-config-value "[MPM]AutoInstall=1" && \ | |
| mpm --set-repository=https://mirrors.tuna.tsinghua.edu.cn/CTAN/systems/win32/miktex/tm/packages/ && \ | |
| rm -rf /var/lib/apt/lists/* |
This file contains hidden or 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
| FROM ubuntu:jammy | |
| RUN sed -E -i "s/(archive|security).ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" /etc/apt/sources.list && \ | |
| apt update && apt upgrade -y && \ | |
| DEBIAN_FRONTEND=noninteractive apt install -y \ | |
| tzdata curl wget ca-certificates gnupg lsb-release \ | |
| build-essential pkg-config ninja-build git \ | |
| meson libglib2.0-dev libpixman-1-dev zlib1g-dev \ | |
| libslirp-dev libsdl2-dev libaio-dev libcap-dev \ | |
| libiscsi-dev libnfs-dev libseccomp-dev \ | |
| python3 python-is-python3 python3-venv python3-pip && \ | |
| rm -rf /var/lib/apt/lists/* | |
| ENV TZ=Asia/Shanghai | |
| RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple | |
| # QEMU 9.2.3 | |
| WORKDIR /root | |
| RUN wget https://download.qemu.org/qemu-9.2.3.tar.xz && \ | |
| tar xf qemu-9.2.3.tar.xz && \ | |
| cd qemu-9.2.3 && \ | |
| python3 -m venv .venv && \ | |
| . .venv/bin/activate && \ | |
| pip install --no-input tomli && \ | |
| ./configure --prefix=/opt/qemu --target-list=riscv64-softmmu \ | |
| --enable-slirp --enable-system --enable-kvm && \ | |
| make -j"$(nproc)" && make install && \ | |
| cd .. && rm -rf qemu-9.2.3 qemu-9.2.3.tar.xz | |
| ENV PATH="/opt/qemu/bin:$PATH" | |
| # OpenEuler 24.03 | |
| WORKDIR /root/openEuler | |
| RUN wget https://repo.openeuler.org/openEuler-24.03-LTS/virtual_machine_img/riscv64/RISCV_VIRT_CODE.fd && \ | |
| wget https://repo.openeuler.org/openEuler-24.03-LTS/virtual_machine_img/riscv64/RISCV_VIRT_VARS.fd && \ | |
| wget https://repo.openeuler.org/openEuler-24.03-LTS/virtual_machine_img/riscv64/openEuler-24.03-LTS-riscv64.qcow2.xz && \ | |
| wget https://repo.openeuler.org/openEuler-24.03-LTS/virtual_machine_img/riscv64/start_vm.sh && \ | |
| sed -i '/-drive file=.*id=hd0/s/id=hd0/id=hd0,if=none/' start_vm.sh && \ | |
| chmod +x start_vm.sh && \ | |
| unxz openEuler-24.03-LTS-riscv64.qcow2.xz | |
| # start | |
| CMD ["./start_vm.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment