You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.2 KiB
Markdown
57 lines
1.2 KiB
Markdown
|
|
|
|
## 基础镜像构建
|
|
|
|
```bash
|
|
# 安装 jupyter所需要的基础软件
|
|
$ apt install ca-certificates
|
|
|
|
# 创建一个rocker用户和他的home
|
|
$ useradd -m -s /bin/bash rocker -u 7788
|
|
$ passwd rocker quant_u2Oh0Go9J76aQb3h7Ybgapw@yanguangshaonian
|
|
|
|
# 创建一个rocker的用户组并把上面的用户添加到组中
|
|
$ usermod -g 7788 -aG rocker rocker
|
|
|
|
# 删除ubuntu用户和他的组
|
|
$ userdel -r ubuntu && groupdel ubuntu
|
|
|
|
# 允许sodo权限 /etc/sudoers 添加 %rocker ALL=(ALL:ALL) ALL
|
|
$ echo "%rocker ALL=(ALL:ALL) ALL" >> /etc/sudoers
|
|
|
|
# vi编辑 /etc/group 最后修改或者添加 rocker:x:7788:rocker
|
|
$ vi /etc/group
|
|
|
|
# vi 编辑 /etc/passwd 最后修改或者添加 rocker:x:7788:7788:rocker:/home/rocker:/bin/bash
|
|
$ vi /etc/passwd
|
|
|
|
# 创建 /log/logs 文件
|
|
$ mkdir /log
|
|
$ touch /log/logs
|
|
|
|
# 删除history历史命令
|
|
$ history -c
|
|
|
|
# 清空.viminfo
|
|
$ echo > ~/.viminfo
|
|
|
|
|
|
# vi 编辑 /etc/resolv.conf, 添加 nameserver 8.8.8.8
|
|
$ vi /etc/resolv.conf
|
|
|
|
# vi 编辑 /etc/hosts 添加 127.0.0.1 rocker
|
|
$ vi /etc/hosts
|
|
|
|
|
|
# 上传 pypy 解压之后根据文件夹 放到 /usr 对应的目录
|
|
# 到根目录, 使用 python -m venv python_env 创建虚拟环境
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
``` |