(编辑:jimmy 日期: 2024/12/29 浏览:2)
export DOCKER_REGISTRY=registry.cn-hangzhou.aliyuncs.com/cqy_test docker login $DOCKER_REGISTRY --username=西交陈清源
拉取基础镜像
docker pull registry.cn-shanghai.aliyuncs.com/tcc-public/python:3 #基础镜像地址 #https://tianchi.aliyun.com/forum/postDetail"htmlcode">wget http://tianchi-media.oss-cn-beijing.aliyuncs.com/docker-tool/tianchi_docker.zip unzip tianchi_docker.zip或者进入镜像修改
docker run --gpus all -it registry.cn-shanghai.aliyuncs.com/tcc-public/pytorch:1.4-cuda10.1-py3 /bin/bash #测试时如需数据集,则可以将本地路径映射到镜像中 docker run --gpus all -it -v /tmp:/tcdata registry.cn-shanghai.aliyuncs.com/tcc-public/pytorch:1.4-cuda10.1-py3 /bin/bash pip intall *** #新开一个终端 #查看当前容器(运行中的镜像) docker ps #打包生成新的base镜像 docker commit 容器ID registry.cn-shenzhen.aliyuncs.com/test_for_tianchi/test_for_tianchi_submit:base最后执行docker_build.sh或者分步执行:
#构建 docker build -t registry.cn-shenzhen.aliyuncs.com/test_for_tianchi/test_for_tianchi_submit:1.0 . #本地测试 nvidia-docker run your_image sh run.sh #上传 docker push registry.cn-shenzhen.aliyuncs.com/test_for_tianchi/test_for_tianchi_submit:1.0