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, ∼1048🔥, 0💬
Popular Posts:
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard i...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...
How to add request query string Parameters to my Azure API operation to make it more user friendly? ...
How to use the "rewrite-uri" Policy Statement for an Azure API service operation? The "rewrite-uri" ...
How To Pad an Array with the Same Value Multiple Times in PHP? If you want to add the same value mul...