I have an application that I am converting into a docker container.
I am going to test some different configuration for the application regarding persisted vs non persisted storage.
E.g. in one scenario I am going to create a persisted volume and mount some data into that volume.
In another scenario I am going to test not having any persisted volume (and accept that any date generated while the container is running is gone when its stopped/restarted).
Regarding the first scenario that works fine. But when I am testing the second scenario – no persisted storage – I am not quite sure what to do on the docker side.
Basically does it make any sense do define a volume in my Dockerfile when I don’t plan to have any persisted volumes in kubernetes?
E.g. here is the end of my
... ENTRYPOINT ["./bin/run.sh"] VOLUME /opt/application-x/data
So does it make any sense at all to have the last line when I don’t create and kubernetes volumes?
Or to put it in another way, are there scenarios where creating a volume in a dockerfile makes sense even though no corresponding persistent volumes are created?