-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
70 lines (59 loc) · 1.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# This file is a part of MRNIU/cmake-kernel
# (https://github.com/MRNIU/cmake-kernel).
#
# Dockerfile for MRNIU/cmake-kernel.
FROM ubuntu:latest
# 替换为你想要的用户名
ARG user=zone
ARG password=zone
# 元数据
LABEL maintainer="Zone.N" email="[email protected]"
# 安装所有依赖
RUN DEBIAN_FRONTEND=noninteractive \
&& apt update \
&& apt install --no-install-recommends --fix-missing -y \
curl \
wget \
sudo \
zsh \
zip \
openssh-server \
rsync \
tar \
git \
vim \
doxygen \
graphviz \
make \
cmake \
clang-format \
qemu-system \
build-essential \
binutils \
valgrind \
gdb-multiarch \
gcc \
g++ \
gcc-riscv64-linux-gnu \
g++-riscv64-linux-gnu \
&& apt clean \
&& git config --global --add safe.directory '*' \
&& sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 设置 ssh
RUN 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
# 添加用户
RUN useradd --create-home --no-log-init --shell /bin/zsh ${user} \
&& adduser ${user} sudo \
&& echo "${user}:${password}" | chpasswd
# 指定容器登录用户
# USER ${user}
# 指定容器起来的工作目录
WORKDIR /home/${user}
# 开放 22 端口
EXPOSE 22
# 启动 ssh 服务
ENTRYPOINT service ssh restart && bash