Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
rcore-os
RCore Tutorial V3
提交
da13d093
R
RCore Tutorial V3
项目概览
rcore-os
/
RCore Tutorial V3
上一次同步 1 年多
通知
15
Star
793
Fork
260
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
RCore Tutorial V3
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
da13d093
编写于
7月 18, 2022
作者:
chyyuu1972
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update Dockerfile: ubuntu 18.04-->20.04, QEMU-5.0-->7.0
上级
6b0d8e3f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
85 addition
and
40 deletion
+85
-40
Dockerfile
Dockerfile
+85
-40
未找到文件。
Dockerfile
浏览文件 @
da13d093
FROM
ubuntu:18.04
LABEL
maintainer="dinghao188" \
version="1.1" \
description="ubuntu 18.04 with tools for tsinghua's rCore-Tutorial-V3"
#install some deps
RUN
set
-x
\
&&
apt-get update
\
&&
apt-get
install
-y
curl wget autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev
\
gawk build-essential bison flex texinfo gperf libtool patchutils bc xz-utils
\
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev git tmux python3
#install rust and qemu
RUN
set
-x
;
\
RUSTUP
=
'/root/rustup.sh'
\
&&
cd
$HOME
\
#install rust
&& curl https://sh.rustup.rs -sSf > $RUSTUP && chmod +x $RUSTUP \
&& $RUSTUP -y --default-toolchain nightly --profile minimal \
#compile qemu
&& wget https://ftp.osuosl.org/pub/blfs/conglomeration/qemu/qemu-5.0.0.tar.xz \
&& tar xvJf qemu-5.0.0.tar.xz \
&& cd qemu-5.0.0 \
&& ./configure --target-list=riscv64-softmmu,riscv64-linux-user \
&& make -j$(nproc) install \
&& cd $HOME && rm -rf qemu-5.0.0 qemu-5.0.0.tar.xz
#for chinese network
RUN
set
-x
;
\
APT_CONF
=
'/etc/apt/sources.list'
;
\
CARGO_CONF
=
'/root/.cargo/config'
;
\
BASHRC
=
'/root/.bashrc'
\
&&
echo
'export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static'
>>
$BASHRC
\
&&
echo
'export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup'
>>
$BASHRC
\
&&
touch
$CARGO_CONF
\
&&
echo
'[source.crates-io]'
>
$CARGO_CONF
\
&&
echo
"replace-with = 'ustc'"
>>
$CARGO_CONF
\
&&
echo
'[source.ustc]'
>>
$CARGO_CONF
\
&&
echo
'registry = "git://mirrors.ustc.edu.cn/crates.io-index"'
>>
$CARGO_CONF
\ No newline at end of file
# syntax=docker/dockerfile:1
# This Dockerfile is adapted from https://github.com/LearningOS/rCore-Tutorial-v3/blob/main/Dockerfile
# with the following major updates:
# - ubuntu 18.04 -> 20.04
# - qemu 5.0.0 -> 7.0.0
# - Extensive comments linking to relevant documentation
FROM
ubuntu:20.04
ARG
QEMU_VERSION=7.0.0
ARG
HOME=/root
# 0. Install general tools
ARG
DEBIAN_FRONTEND=noninteractive
RUN
apt-get update
&&
\
apt-get
install
-y
\
curl
\
git
\
python3
\
wget
# 1. Set up QEMU RISC-V
# - https://learningos.github.io/rust-based-os-comp2022/0setup-devel-env.html#qemu
# - https://www.qemu.org/download/
# - https://wiki.qemu.org/Documentation/Platforms/RISCV
# - https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html
# 1.1. Download source
WORKDIR
${HOME}
RUN
wget https://download.qemu.org/qemu-
${
QEMU_VERSION
}
.tar.xz
&&
\
tar
xvJf qemu-
${
QEMU_VERSION
}
.tar.xz
# 1.2. Install dependencies
# - https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html#prerequisites
RUN
apt-get
install
-y
\
autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev
\
gawk build-essential bison flex texinfo gperf libtool patchutils bc
\
zlib1g-dev libexpat-dev git
\
ninja-build pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev
# 1.3. Build and install from source
WORKDIR
${HOME}/qemu-${QEMU_VERSION}
RUN
./configure
--target-list
=
riscv64-softmmu,riscv64-linux-user
&&
\
make
-j
$(
nproc
)
&&
\
make
install
# 1.4. Clean up
WORKDIR
${HOME}
RUN
rm
-rf
qemu-
${
QEMU_VERSION
}
qemu-
${
QEMU_VERSION
}
.tar.xz
# 1.5. Sanity checking
RUN
qemu-system-riscv64
--version
&&
\
qemu-riscv64
--version
# 2. Set up Rust
# - https://learningos.github.io/rust-based-os-comp2022/0setup-devel-env.html#qemu
# - https://www.rust-lang.org/tools/install
# - https://github.com/rust-lang/docker-rust/blob/master/Dockerfile-debian.template
# 2.1. Install
ENV
RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=nightly
RUN
set
-eux
;
\
curl
--proto
'=https'
--tlsv1
.2
-sSf
https://sh.rustup.rs
-o
rustup-init
;
\
chmod
+x rustup-init
;
\
./rustup-init
-y
--no-modify-path
--profile
minimal
--default-toolchain
$RUST_VERSION
;
\
rm
rustup-init
;
\
chmod
-R
a+w
$RUSTUP_HOME
$CARGO_HOME
;
# 2.2. Sanity checking
RUN
rustup
--version
&&
\
cargo
--version
&&
\
rustc
--version
# 3. Build env for labs
# See os1/Makefile `env:` for example.
# This avoids having to wait for these steps each time using a new container.
RUN
rustup target add riscv64gc-unknown-none-elf
&&
\
cargo
install
cargo-binutils
--vers
~0.2
&&
\
rustup component add rust-src
&&
\
rustup component add llvm-tools-preview
# Ready to go
WORKDIR
${HOME}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录