• Docker Container creates new Repository on each run

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #49000  by kalle42
 
Hello,

I'm running OpenKM-CE in a docker container on Win10.

To save my changes to the repository I added a volume to the docker run call
Code: Select all
docker run -p 8080:8080 -v C:/users/kalle42/openkm/repository:/opt/openkm/repository openkm/openkm-ce
That worked well and I can see the database files and the uploaded documents in the datastore subfolder in the connected windows folder. After stopping the container all data stays in the connected windows container. But after running the container again, unfortunately all data was remove and a new repository was created.

I had a look to the OpenKM.cfg file
Code: Select all
root@c4fddfc92443:/opt/openkm# more OpenKM.cfg
# OpenKM Hibernate configuration values
hibernate.dialect=org.hibernate.dialect.H2Dialect
#hibernate.dialect=org.hibernate.dialect.HSQLDialect
#hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
#hibernate.dialect=org.hibernate.dialect.SQLServerDialect
#hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
#hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
hibernate.hbm2ddl=none
But I think the "hibernate.hbm2ddl=none" property does no reach the initialization
Code: Select all
02-Oct-2019 12:27:28.052 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization completed in 10637 ms
2019-10-02 12:27:28,078 [localhost-startStop-1] INFO  com.openkm.core.Config - ** Application OpenKM has DTDs at /opt/openkm/webapps/OpenKM/WEB-INF/classes/dtd **
2019-10-02 12:27:28,086 [localhost-startStop-1] INFO  com.openkm.core.Config - ** Language profiles at /opt/openkm/webapps/OpenKM/WEB-INF/classes/lang-profiles **
2019-10-02 12:27:28,090 [localhost-startStop-1] INFO  com.openkm.core.Config - ** Reading config file /opt/openkm/OpenKM.cfg **
2019-10-02 12:27:28,102 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - cloud.max.repository.size=0
2019-10-02 12:27:28,109 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - cloud.max.users=0
2019-10-02 12:27:28,110 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - cloud.mode=false
2019-10-02 12:27:28,110 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.create.autofix=true
2019-10-02 12:27:28,111 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.datasource=java:/comp/env/jdbc/OpenKMDS
2019-10-02 12:27:28,112 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.dialect=org.hibernate.dialect.H2Dialect
2019-10-02 12:27:28,113 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.hbm2ddl=create
2019-10-02 12:27:28,114 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.search.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer
2019-10-02 12:27:28,116 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.search.index.exclusive=true
2019-10-02 12:27:28,129 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.search.index.home=/opt/openkm/repository/index
2019-10-02 12:27:28,130 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.show_sql=false
2019-10-02 12:27:28,134 [localhost-startStop-1] INFO  com.openkm.core.Config - LOAD - hibernate.statistics=false
This is just an idea, maybe it's sth. else.
Help is appreciated, if someone has a clue, how I can configure the container that openKM connects to an existing repository, if there is one.
Furthermore I'm interested, if that is right way to save all transaction data, that can be created or changed a by users during a session.
Thank you.
 #49017  by kalle42
 
Sorry, I did not know yet, that there is a another way to "run" a docker container.
Usual "Getting Startet" advices do not go further then running the container.

Thinking on that, it makes sense to have this second option.

I will try later, but I think this was my problem. If not, I come back again ...

Thank you and excuse my inexperience,
Kalle
 #49813  by bscott
 
I had the same problem with a new database being created on docker run.

I edited the OpenKM.cfg file in a running container changing hibernate.hbm2ddl=none to hibernate.hbm2ddl.auto=none.

I then created an image from that container with docker commit <running-container> <new-image>

That fixed the problem for me.

The image is on dockerhub at bscott26/openkm.

The standard openkm/openkm-ce should be run first to create the database.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.