docker创建,镜像打包

## 说明 ##
1. 设置端口
2. 设置挂载数据卷

后续测试使用这个镜像


#### 创建数据卷 ####
```shell
docker volume ls
docker volume create RagFile
```

#### 创建容器 ####
chatchat启动默认为8501端口
```shell
docker run -itd -p 8020:8501 -v RagFile:/home/file ubuntu:python
```


## 说明 ##
1. 创建ubuntu+anaconda基础容器
2. 提交为镜像

基础镜像


#### 创建&进入 容器 ####
```shell
docker run -itd -e LANG=C.UTF-8 --name base_python ubuntu:latest
docker exec -it base_python bash
```

#### 下载常用包 ####
```shell
apt-get update
apt-get install -y wget vim curl
```

#### 安装Miniconda ####
Miniconda各版本网址 https://repo.anaconda.com/miniconda/
```shell
# 获取python版本3.11.7
wget https://repo.anaconda.com/miniconda/Miniconda3-py311_24.1.2-0-Linux-x86_64.sh
sh Miniconda3-py311_24.1.2-0-Linux-x86_64.sh
rm Miniconda3-py311_24.1.2-0-Linux-x86_64.sh
```

#### 配置Miniconda环境变量 ####
```shell
vi ~/.bashrc
export PATH=$PATH:/root/miniconda3/bin
source ~/.bashrc
exit
```

#### 打包为镜像 ####

```shell
docker commit base_python ubuntu:python
```
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值