Ubuntu 19.04
Sponsored Link

Docker : Add Container images2019/04/25

 
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              94e814e2efa8        6 weeks ago         88.9MB

# 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
87a708c148bd        ubuntu              "/bin/bash -c 'apt-g…"   32 seconds ago      Exited (0) 3 seconds ago                         zealous_shaw

# add the image

root@dlp:~#
docker commit 87a708c148bd srv.world/ubuntu_apache2

sha256:c0d10606acdec4cca96d2c8c310bac3d09bd6489ceac2703cfe1389bada59f8e

root@dlp:~#
docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
srv.world/ubuntu_apache2   latest              c0d10606acde        13 seconds ago      210MB
ubuntu                     latest              94e814e2efa8        6 weeks ago         88.9MB

# 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