In a Docker application, How to maintain add-on application when upgrading the base image(Code-server)?

40 Views Asked by At

I have been using code-server for almost a year. It is a web-based programming IDE running on docker. https://hub.docker.com/r/linuxserver/code-server

And I use it to develope JAVA and PYTHON. Therefore I install JVM and python runtime, also many PIP packages into the container.

I know docker container are not supposed to store application, and custom data are best maintained in a mounted volumn seperated from the container.

But as a programming IDE situation, those programs are subjected to change and accumulated on day-to-day usage.

It comes to headache when upgrading the base image, because those JVM, python packages, and other middleware needed to be re-installed.

I did some reading about DOCKER inheritance and watchtower, but I still not quite sure those are correct approach.

So I would like to ask if there are solutions to keep my newly added programs in the container when upgrading the code-server image?

1

There are 1 best solutions below

0
random coder dude On

For the JVM and Java/Python packages, mount a volume. I would also keep your working project directories in a mounted volume (In addition to your VCS of choice). From here, watchtower can takeover and handle the updates. If you are using Git, I would not recommend storing your packages/binaries in Git.