Docker : Add Container images2025/08/26 |
|
Add Container images you created. |
|
| [1] | For example, update official image with installing Nginx and add it as a new image for container. The container is generated every time for executing docker run command, so add the latest executed container like follows. |
|
# show images root@dlp:~# docker images REPOSITORY TAG IMAGE ID CREATED SIZE debian latest 047bd8d81940 2 weeks ago 120MB # start a Container and install nginx root@dlp:~# docker run debian /bin/bash -c "apt-get update; apt-get -y install nginx" docker ps -a | head -2 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0ade68efc0ae debian "/bin/bash -c 'apt-g…" 13 seconds ago Exited (0) 8 seconds ago trusting_aryabhata # add the image root@dlp:~# docker commit 0ade68efc0ae srv.world/debian-nginx sha256:64fe195a727d3287b89747f4150a58db42e717eef899840a236493e8a9e951faroot@dlp:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE srv.world/debian-nginx latest 64fe195a727d 10 seconds ago 153MB debian latest 047bd8d81940 2 weeks ago 120MB # generate a container from the new image to make sure the nginx exists root@dlp:~# docker run srv.world/debian-nginx /usr/sbin/nginx -V nginx version: nginx/1.26.3 built with OpenSSL 3.5.0 8 Apr 2025 (running with OpenSSL 3.5.1 1 Jul 2025) TLS SNI support enabled ..... ..... |
| Sponsored Link |
|
|