Summary of common commands submitted in docker competition
- 2021-10-13 09:02:48
- OfStack
Login account
export DOCKER_REGISTRY=registry.cn-hangzhou.aliyuncs.com/cqy_test
docker login $DOCKER_REGISTRY --username= Xijiao Chen Qingyuan
Create your own image
Pull the base image
docker pull registry.cn-shanghai.aliyuncs.com/tcc-public/python:3
# Base mirror address
#https://tianchi.aliyun.com/forum/postDetail?spm=5176.12586973.0.0.176a4127dBw2Xr&postId=67720
Get the mirroring toolkit and modify dockerfile according to your own needs
wget http://tianchi-media.oss-cn-beijing.aliyuncs.com/docker-tool/tianchi_docker.zip
unzip tianchi_docker.zip
Or enter the mirror modification
docker run --gpus all -it registry.cn-shanghai.aliyuncs.com/tcc-public/pytorch:1.4-cuda10.1-py3 /bin/bash
# If you need a dataset for testing, you can map the local path to the image
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 ***
# Newly opened 1 Terminals
# View the current container (running image)
docker ps
# Package to generate a new base Mirror image
docker commit Container ID registry.cn-shenzhen.aliyuncs.com/test_for_tianchi/test_for_tianchi_submit:base
Finally, execute docker_build. sh or step by step:
# Build
docker build -t registry.cn-shenzhen.aliyuncs.com/test_for_tianchi/test_for_tianchi_submit:1.0 .
# Local testing
nvidia-docker run your_image sh run.sh
# Upload
docker push registry.cn-shenzhen.aliyuncs.com/test_for_tianchi/test_for_tianchi_submit:1.0