Committing changes made in a Docker without using Dockerfile

  1. Comprehensive Blog on Dockers running on OCI
  2. running a Docker Container on OCI
  3. opening OCI Ports for Docker Containers
  4. Building a Docker Image by using Dockerfile
  5. Committing changes made in a Docker without using Dockerfile
  6. Pushing Docker Images to Docker Hub
  7. DevOps with Github, Docker Hub and Oracle Container Cloud Services

Sometimes you might want to do complex operations which might need you get the base image and then update changes and commit , typical example would be creating a tomcat image , deploying your war file and then committing the changes by tagging a particular version.

Spin up a container
[email protected]:~$ docker run -it debian:latest
[email protected]:/# ls
bin   dev  home  lib64	mnt  proc  run	 srv  tmp  var
boot  etc  lib	 media	opt  root  sbin  sys  usr
[email protected]:/# ls > newlistfile.txt
[email protected]:/# apt-get update && apt-get install -y git
Ign:1 stretch InRelease                
Get:2 stretch-updates InRelease [91.0 kB]
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
[email protected]:/# ls
bin   dev  home  lib64	mnt		 opt   root  sbin  sys	usr
boot  etc  lib	 media	newlistfile.txt  proc  run   srv   tmp	var
[email protected]:/# exit
Commit to the Repo
[email protected]:/# exit
[email protected]:~$ docker ps -a
CONTAINER ID        IMAGE                        COMMAND              CREATED             STATUS                       PORTS               NAMES
c8c24ffca1d6        debian:latest                "bash"               3 minutes ago       Exited (127) 6 seconds ago                       vibrant_shirley
4ecfe884aecf        jamessmith73/debian:latest   "cat listfile.txt"   38 minutes ago      Exited (0) 38 minutes ago                        confident_yonath
c00aeaaee7ca        jamessmith73/debian:latest   "ls"                 38 minutes ago      Exited (0) 38 minutes ago                        sad_davinci
192bd7f7870f        jamessmith73/debian:latest   "bash"               39 minutes ago      Exited (0) 39 minutes ago                        blissful_goldstine
[email protected]:~$ docker commit c8c24ffca1d6 jamessmith73/debian:2.0
[email protected]:~$ docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
jamessmith73/debian   2.0                 75e65a41a95e        30 seconds ago      218MB
jamessmith73/debian   1.0                 90c1c24a6dd6        15 minutes ago      249MB
jamessmith73/debian   latest              170489bdc17e        About an hour ago   249MB
tomcat                latest              ca9e2fccef98        7 days ago          463MB
debian                latest              be2868bebaba        3 weeks ago         101MB
busybox               latest              59788edf1f3e        5 weeks ago         1.15MB
hello-world           latest              4ab4c602aa5e        8 weeks ago         1.84kB
[email protected]:~$ 

What Next >> Pushing Docker Image to