jjethwa / rundeck

GNU General Public License v3.0
123 stars 137 forks source link

Unable to get data to persist #138

Open cgd1 opened 6 years ago

cgd1 commented 6 years ago

Hi - firstly, thank you for creating the repo, saved me some time!

What would be the best practice to get the container to retain data/settings after restart? Any assistance would be greatly appreciated

With respect Craig

jjethwa commented 6 years ago

Hi @cgd1

Thanks so much! 😄

I would suggest using volumes to persist your data across restarts and container updates. At the very minimum you need volumes for /etc/rundeck and /var/lib/mysql.

Optional or config dependent

  1. filesystem method for storing projects needs /var/rundeck. Note: Rundeck now uses the database for this by default (Configured via RUNDECK_PROJECT_STORAGE_TYPE)
  2. filesystem method for key storage needs /var/lib/rundeck/var/storage (Configured via RUNDECK_STORAGE_PROVIDER)
  3. Extra plugins /opt/rundeck-plugins
  4. Rundeck logs /var/logs/rundeck
cgd1 commented 6 years ago

Thank you for the timely response!

Ok, so at run, I need to add: -v rundeck_data:/etc/rundeck

Like so: docker volume create rundeck_data docker run -p 4440:4440 -t rundeck3:latest -v rundeck_data:/etc/rundeck

jjethwa commented 6 years ago

@cgd1

That's correct. You should create separate directories for each volume so maybe something like

-v rundeck_etc_rundeck:/etc/rundeck -v rundeck_var_lib_mysql:/var/lib/mysql

or similar depending on how you like to organize things 😄 I also like to use exact paths just to make sure nothing weird happens.

cgd1 commented 6 years ago

I'm scratching my head here - I cant seem to get it top work

docker run -p 4440:4440 -t rundeck3:latest -v rundeck_etc_rundeck:/etc/rundeck -v rundeck_var_lib_mysql:/var/lib/mysql

Thats what I used, just doesnt seem to work - its working for other containers

jjethwa commented 6 years ago

@cgd1 do you see anything getting generated under the volume directories after starting the container? Are there any errors in the container logs?

docker logs <CONTAINER_NAME>
jjethwa commented 6 years ago

Hi @cgd1

Any updates?