skip to Main Content

I am using docker to run an application but every time i need to update the application on production, i have to build on a new image locally, push/pull and run it on production, but the application is almost 5gb.
Is there a way to just push the changes, push them and then run the new image with the changes based on its previous image?

any help on this matter?

2

Answers


    1. Docker’s layer caching mechanism to reduce the amount of data that needs to be transferred when updating your application.
    2. If you have static data that remains constant – You can mount a directory using -v tag to get the contents of folder in your image
    Login or Signup to reply.
  1. Whilst the other answers mention (in very specific language, btw) using the layer caching mechanism, they haven’t said how.

    The important thing is to have the code that changes at the end of your Dockerfile. That way, later builds can use the cached layers that don’t change, and only rebuild (and push/pull) the layers with new stuff in.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search