forked from Simple-XX/SimpleKernel
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Zone.N <[email protected]>
- Loading branch information
Showing
5 changed files
with
107 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -27,7 +27,7 @@ boot branch | |
|
||
## 快速开始 | ||
|
||
1. 需要 Ubuntu 环境 | ||
1. 需要 Ubuntu 环境或使用 docker(见 tools/docker.md) | ||
|
||
2. 安装依赖 | ||
|
||
|
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,16 @@ | ||
#!/bin/bash | ||
|
||
# This file is a part of Simple-XX/SimpleKernel | ||
# (https://github.com/Simple-XX/SimpleKernel). | ||
# | ||
# docker.sh for Simple-XX/SimpleKernel. | ||
# 运行预制了工具链的 docker | ||
|
||
# shell 执行出错时终止运行 | ||
set -e | ||
# 输出实际执行内容 | ||
set -x | ||
|
||
docker pull ptrnull233/simple_kernel:latest | ||
docker run --name SimpleKernel-container -itd -p 233:22 -v ./:/root/SimpleKernel ptrnull233/simple_kernel:latest | ||
docker exec -it SimpleKernel-container /bin/zsh |
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,78 @@ | ||
|
||
# This file is a part of Simple-XX/SimpleKernel | ||
# (https://github.com/Simple-XX/SimpleKernel). | ||
# | ||
# Dockerfile for Simple-XX/SimpleKernel. | ||
|
||
FROM ubuntu:latest AS basic_os | ||
RUN export DEBIAN_FRONTEND=noninteractive && apt update && apt upgrade -y | ||
ENV LANG=C.UTF-8 | ||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt | ||
|
||
FROM basic_os AS basic_tools | ||
RUN apt install --no-install-recommends --fix-missing -y \ | ||
locales \ | ||
ca-certificates \ | ||
git \ | ||
curl \ | ||
wget \ | ||
openssh-server \ | ||
rsync \ | ||
sudo \ | ||
zsh \ | ||
zip \ | ||
tar | ||
RUN apt install --no-install-recommends --fix-missing -y \ | ||
vim \ | ||
doxygen \ | ||
valgrind \ | ||
graphviz \ | ||
clang-format \ | ||
clang-tidy \ | ||
cppcheck \ | ||
lcov | ||
RUN locale-gen en_US.UTF-8 && locale-gen zh_CN.UTF-8 \ | ||
&& mkdir -p /var/run/sshd \ | ||
&& echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config \ | ||
&& echo 'PubkeyAuthentication yes' >> /etc/ssh/sshd_config \ | ||
&& echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config \ | ||
&& ssh-keygen -A \ | ||
&& service ssh restart \ | ||
&& git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh \ | ||
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \ | ||
&& cp -r ~/.oh-my-zsh /home/ubuntu/ \ | ||
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template /home/ubuntu/.zshrc \ | ||
&& chsh -s /bin/zsh root \ | ||
&& usermod -s /bin/zsh root \ | ||
&& chsh -s /bin/zsh ubuntu \ | ||
&& usermod -s /bin/zsh ubuntu | ||
|
||
FROM basic_tools AS dev_tools | ||
RUN apt install --no-install-recommends --fix-missing -y \ | ||
build-essential \ | ||
binutils \ | ||
make \ | ||
cmake \ | ||
git \ | ||
qemu-system \ | ||
gdb-multiarch \ | ||
libgtest-dev | ||
RUN apt install --no-install-recommends --fix-missing -y \ | ||
gcc \ | ||
g++ \ | ||
gcc-riscv64-linux-gnu \ | ||
g++-riscv64-linux-gnu \ | ||
gcc-aarch64-linux-gnu \ | ||
g++-aarch64-linux-gnu \ | ||
gcc-riscv64-linux-gnu \ | ||
g++-riscv64-linux-gnu \ | ||
gcc-x86-64-linux-gnu \ | ||
g++-x86-64-linux-gnu | ||
|
||
FROM dev_tools AS simple_kernel | ||
EXPOSE 22 | ||
USER root | ||
WORKDIR /root | ||
RUN apt autoremove -y && apt clean -y && rm -rf /var/lib/apt/lists/* \ | ||
&& git config --global --add safe.directory /root/SimpleKernel | ||
ENTRYPOINT ["/bin/zsh"] |