Docker : Add Container images2021/08/30 |
Add Container images you created.
|
|
[1] | For exmaple, 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 fe3c5de03486 12 days ago 124MB # 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 f6fddf4b540e debian "/bin/bash -c 'apt-g…" 26 seconds ago Exited (0) 8 seconds ago nifty_bhabha # add the image root@dlp:~# docker commit f6fddf4b540e srv.world/debian-nginx sha256:e07733601f3035553aaa4125b8ab8262f7f9b7360908ca6b0e5ec3ce36284154root@dlp:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE srv.world/debian-nginx latest e07733601f30 6 seconds ago 210MB debian latest fe3c5de03486 12 days ago 124MB # generate a container from the new image and execute [which] to make sure nginx exists root@dlp:~# docker run srv.world/debian-nginx /usr/bin/which nginx /usr/sbin/nginx |
Sponsored Link |