greyltc / docker-owncloud

Arch linux based docker container with owncloud
111 stars 37 forks source link

existing containerized data + fresh owncloud container #35

Closed hugoliv closed 9 years ago

hugoliv commented 9 years ago

Hi,

Try this out:

Pull and run two clean and fresh containers (using the official latest PostgresSQL with data stored outside of the container and l3iggs/docker-owncloud container). Then you are able to reach the owncloud app through the browser and create the admin account following the wiki. Everything is working fine.

Then, stop, delete and run fresh new containers (with postgres using the same data directory stored outside the container). Then, reach the owncloud app through the browser and, unfortunately, you will be asked to create an admin account. You can't use the already created admin account with a message such as "login already exists" and if you use a new login account, the app says:

 "Error occurred while checking PostgreSQL version"
 "Please make sure you have PostgreSQL >= 9 or check the logs for more information about the error".
hugoliv commented 9 years ago

Hum, that "issue" seems to be caused by the fact that the config wasn't stored on the host... Because the config.php is now stored outside the container, it seems to be ok.

But could you please explain me something? In the config.php, the data directory is set with:

 'datadirectory' => '/usr/share/webapps/owncloud/data',

So, the container's file system let me observe the owncloud files but the same files are also stored outside the container. Are the files stored twice ?

l3iggs commented 9 years ago

Looks like you've answered your own question here: All the initial setup data is indeed stored in your config.php file. You have to restore that file if you don't want to be asked the initial setup questions.

About your question regarding if the files are stored twice: What is the full docker command you're using to start the ownCloud container? Are you using a -v directive there? If so, that directive specifies a mapping between a folder on the cost and a folder in the container, and the answer would be "No, the files are not stored twice."

hugoliv commented 9 years ago

Hello,

 What is the full docker command you're using to start the ownCloud container? Are you using a -v directive there?

Yes, I'm using a -v directive. I'm a little bit confused because I can see the files both in the container and on the host.

l3iggs commented 9 years ago

You should read up on how data volumes work in containers: https://docs.docker.com/userguide/dockervolumes/

hugoliv commented 9 years ago

Well, my bad, everything is in the doc. Thanks for your answer.

l3iggs commented 9 years ago

No prob! I'm glad it helped.