<p>I am migrating an application in Nodejs to kubernetes in GCP. In CI tutorials, I see the updated application being copied to a new docker image and sent to GCR.</p>

<p>The process of uploading an image is slow compared to updating only the code. So what exactly is the gain of sending a new image containing the application?</p>

<p>You are missing the whole docker philosophy and the concept of immutable infrastructure, and the matrix from hell bellow, docker and other container-based technology was originally adopted to address the matrix from hell.
<a href="https://i.stack.imgur.com/ka3SN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ka3SN.jpg" alt="enter image description here"></a></p>

<p>Solution
<a href="https://i.stack.imgur.com/YVBVH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YVBVH.png" alt="enter image description here"></a></p>

<p>Entire books have been written to answer your question why not copy the code and why use the images , but the short answer is , use the docker images and address the slowness by doing some optimizations such as minimal docker images , minimal layers , caching etc</p>

<p><a href="https://medium.com/skills-matter/3-simple-tricks-for-smaller-docker-images-cf2760645621?mkt_tok=eyJpIjoiWTJNeFpXTmtZamd4TXpVeSIsInQiOiJQTU8wUFR1d1RtSFpabUdFVmJoQTJWaTZ5Q2did0lJR3FacVRJYndYQUdQZXhIOE95ZmhSN3oyMXBpVmRpQ09nd3lOcU43Q1dHak1vcnMyWm1ObllKMXRyTG14aE5URHdFU3dzYzlzbXAyTUkrNzVKYkRqOUxscHhYdG80bHRDciJ9" rel="nofollow noreferrer">Minimal docker images</a></p>
