Save volume in docker image for EJBCA #403
-
Hi, But its not working. Also I cannot reach REST API docs. I am aware of no swagger in production mode, but classic doc is unavailable. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You need to use an external database for that, because by default Ejbca docker image uses H2 database and when you stop the container all data will be gone. https://hub.docker.com/r/primekey/ejbca-ce |
Beta Was this translation helpful? Give feedback.
-
That's not quite true. The thing with "docker run" is that it created a new container every run, with new volumes. You can see what volumes are created with "docker volume", then you can see that you old ones are there and new ones are created for the new container started with "docker run". But yes, for production usage you should use an external database, and then you can treat the EJBCA containers as ephemeral and create new ones at will. We have a lot of good tutorials on the KeyfactorCommunity youtube channel. There are some new container specific ones coming up, for performing upgrades for example. |
Beta Was this translation helpful? Give feedback.
That's not quite true. The thing with "docker run" is that it created a new container every run, with new volumes. You can see what volumes are created with "docker volume", then you can see that you old ones are there and new ones are created for the new container started with "docker run".
You can list both started and stopped containers with "docker ps" (check an pages for complete commands).
Once you have created a container you can stop and start it with "docker stop" and "docker start", that is how you use the same volumes. You can probably give arguments to docker run as well to re-use existing volumes.
You typically want to clean up/delete old volumes that are lingering as well, t…