ManageIQ Docker external DB wipes itself

Hi all,

I’m running ManageIQ in a Docker container, inside a Rancher environment, and I’m attempting to connect it to an external Postgres database instead of the built in Postgres.

I’ve modified the DATABASE_URL environment variable to connect to the database, and that bit works, but every time ManageIQ restarts, it decides to drop the database and rebuild it from scratch (so wiping it). There doesn’t seem to be any condition which resolved to true for this behaviour, it just seems to do it every time. Is there any way I can stop this?

On a side note, is there a way to remove the internal Postgres DB from the container if I’m using an external DB?

Thanks :slight_smile:

It sounds like you might be missing your application data persistent volume.
There’s a section “Deploy MIQ using an external database” here but it’s based on OpenShift as the platform rather than Rancher (which I’ve never used). You might be able to glean some ideas though.


Which Docker container are you using?
There is a containerized version of CloudForms built to run on OpenShift and there is the ManageIQ/manageiq image on docker hub

In the second case, i would guess your problem is this file
It checks whether the file /var/opt/rh/rh-postgres95/lib/pgsql/data/base exists and starts to initialize the database

Regarding removal: there is no way to remove stuff from a container (except squashing) and given the fact that the image apparently assumes to run a local porstgres I would try to remove the postgres binaries

You are aware that the dockerhub container image is not meant to be run in production?