Ubuntu 18.04
Sponsored Link

Docker : Add Container images2018/06/12

 
Add Container images you created.
[1] For exmaple, update official image with installing Apache2 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
ubuntu              latest              113a43faa138        6 days ago          81.2MB

# start a Container and install apache2

root@dlp:~#
docker run ubuntu /bin/bash -c "apt-get update; apt-get -y install apache2"

root@dlp:~#
docker ps -a | head -2

CONTAINER ID   IMAGE    COMMAND           CREATED         STATUS                       PORTS  NAMES
78c28ae5cb4f   ubuntu   "/bin/bash -c...  48 seconds ago  Exited (0) 17 seconds ago           sad_pare

# add the image

root@dlp:~#
docker commit 78c28ae5cb4f srv.world/ubuntu_apache2

sha256:b2d00f9d9fb4c054e8aa35527bc9ea0a3c15ab4a3b86accc1f5338ed86598265

root@dlp:~#
docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
srv.world/ubuntu_apache2   latest              b2d00f9d9fb4        18 seconds ago      218MB
ubuntu                     latest              113a43faa138        6 days ago          81.2MB

# Generate a Container from the new image and execute [which] to make sure httpd exists

root@dlp:~#
docker run srv.world/ubuntu_apache2 /usr/bin/which apache2

/usr/sbin/apache2
Matched Content