Tools, FAQ, Tutorials:
Commit New Image with Updated Docker
How to create/commit a new image from the running Docker? I want to keep those changes on the Docker.
✍: FYIcenter.com
If you have made those Conda, Python and CUDA Toolkit changes on the nvidia/cuda Docker, you should follow this tutorial to create/commit a new custom docker image.
1. Verify the running nvidia/cuda Docker.
fyicenter# docker ps CONTAINER ID IMAGE COMMAND STATUS NAMES e4395c83ac54 nvidia/cuda:11.0-base "sleep 36000000" Up 20 hours my_cuda
2. Commit/Create a new Docker image, fyi_cuda, from the running Docker.
fyicenter# docker commit my_cuda fyi_cuda sha256:... fyicenter# docker images REPOSITORY TAG IMAGE ID CREATED SIZE fyi_cuda latest 1a4cb45485ee 4 minutes ago 3.91GB nvidia/cuda 11.0-base 2ec708416bb8 12 months ago 122MB
3. Rename the new Docker image to fyi/cuda:1.
fyicenter# docker image tag 1a4cb45485ee fyi/cuda:1 fyicenter# docker images REPOSITORY TAG IMAGE ID CREATED SIZE fyi_cuda latest 1a4cb45485ee 4 minutes ago 3.91GB fyi/cuda 1 1a4cb45485ee 10 minutes ago 3.91GB nvidia/cuda 11.0-base 2ec708416bb8 12 months ago 122MB fyicenter# docker image remove fyi_cuda fyicenter# docker images REPOSITORY TAG IMAGE ID CREATED SIZE fyi/cuda 1 1a4cb45485ee 10 minutes ago 3.91GB nvidia/cuda 11.0-base 2ec708416bb8 12 months ago 122MB
3. Start, fyi/cuda:1 as a new Docker container.
fyicenter# docker run --name my_cuda_2 --detach fyi/cuda:1 sleep 36000000 fyicenter# docker ps CONTAINER ID IMAGE COMMAND STATUS NAMES 2239e7c983a4 fyi/cuda:1 "sleep 36000000" Up 9 seconds my_cuda_2 e4395c83ac54 nvidia/cuda:11.0-base "sleep 36000000" Up 20 hours my_cuda
4. Verify the new Docker container.
fyicenter# docker exec -it my_cuda_2 /bin/bash (base) root@2239e7c983a4:/# conda activate py3.9 (py3.9) root@2239e7c983a4:/# python --version Python 3.9.6
5. Stop and remove the old Docker container to free up resource.
fyicenter# docker stop my_cuda my_cuda fyicenter# docker ps --all CONTAINER ID IMAGE COMMAND STATUS NAMES 2239e7c983a4 my/cuda:1 "sleep 36000000" Up 5 minutes my_cuda_2 e4395c83ac54 nvidia/cuda:11.0-base "sleep 36000000" Exited (137) my_cuda fyicenter# docker container rm my_cuda my_cuda CONTAINER ID IMAGE COMMAND STATUS NAMES 2239e7c983a4 my/cuda:1 "sleep 36000000" Up 9 minutes my_cuda_2
⇒ Export and Import Docker Image Files
⇐ Install CUDA Toolkit in Conda on nvidia/cuda Docker
2023-02-19, 658🔥, 0💬
Popular Posts:
How To Protect Special Characters in Query String in PHP? If you want to include special characters ...
How to reinstall npm with a node version manager? I am getting permission errors with the current ve...
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...
How to attach console to a Running Container using the "docker container exec" command? I want to ge...
How to install "C++/CLI Support" component in Visual Studio? I need to build my Visual Studio C++/CL...