0

Suppose i have images pulled named, matrix-data and running with container names as matrix. Now i have few bug fixes in my matrix-data images and i want to patch it to current running images.

  1. Stop running container
  2. Build the new images with bug fix.
  3. Pull the images from registry.
  4. Restart the container.

Will the old image be over written with new one and i can start same contanier or there is different way of patching the images?

Thanks!

Sohan
  • 6,252
  • 5
  • 35
  • 56

1 Answers1

2

If I understood your needs, you can make your changes on the running container, then you commit it (using the same tag the image had previous the changes) then optionally you push the new image to the registry.

The new containers you start will contain your changes as the container you have changed.

mgaido
  • 2,987
  • 3
  • 17
  • 39
  • This is contanier specific. Can i do same for image? I mean here how i can ship all new image to remote host where its already running old version on the current image? – Sohan Nov 06 '14 at 11:02
  • 1
    This is not container specific, because when you commit, the image is changed (if you use the same tag when you commit). – mgaido Nov 06 '14 at 11:04
  • OK got it. What happens when one pull the nrew image from repository? Will it override existing image and make changes to container also? – Sohan Nov 06 '14 at 11:09
  • Yes, it will ovveride, but the changes will be effective only for the new containers, ie the containers started after the new pull. – mgaido Nov 06 '14 at 11:16
  • Ok. So existing container will not be affected with new changes. I have to re run image with new container only. – Sohan Nov 06 '14 at 11:21
  • Yes, I believe there is no way to affect existing containers. – mgaido Nov 06 '14 at 11:22
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/64389/discussion-between-sohan-and-mark91). – Sohan Nov 06 '14 at 11:23