docker常用命令汇总
1.查看镜像
docker images
2.进入镜像(cce8f6b2cd89为镜像ID)
docker run -it cce8f6b2cd89 /bin/bash
3.查看镜像中python库的版本号
pip show pyresample
4.在镜像中直接安装库
pip install gdal=3.4.3 (有可能不成功,因为pip为原码安装)
5.在镜像中找某个数据
find -name *conda*
6.查看python版本号
/opt/conda/envs/fgs/bin/python(直接进python中),可直接执行代码,例如:from osgeo import gdal
退出:exit()
7.用conda安装库
conda activate fgs
conda install gdal==3.4.3 或 conda install -c conda-forge gdal==3.4.3
8.查看当前容器
docker ps
9.将文件拷贝到当前环境中
docker cp /mnt/data/migrate/cryosphere/images/GDAL-3.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl 2c0bd34aa256:/opt/conda/envs/fgs
10.安装whl格式的库
pip install GDAL-3.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Processing ./GDAL-3.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
11.导出镜像为tar包
docker export 2c0bd34aa256 > /mnt/data/migrate/cryosphere/images/dt.tar
docker save cloudmap:v0.5 -o /yaogan_dongao/home/wtx/cryosphere/images/cloud.tar
12.加载tar包镜像到服务器上
docker import /mnt/data/migrate/cryosphere/images/dt.tar dt:V1
浙公网安备 33010602011771号