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, 400👍, 0💬
Popular Posts:
What are "*..." and "**..." Wildcard Parameters in Function Definitions? If you want to define a fun...
What are the differences of Differences of evaluateTransaction() and submitTransaction() of the fabr...
Where can I download the EPUB 2.0 sample book "The Metamorphosis" by Franz Kafka? You can following ...
How to Build my "sleep" Docker image from the Alpine image? I want the container to sleep for 10 hou...
How to create the Hello-3.0.epub package? I have all required files to create Hello-3.0.epub. To cre...