Closed ShonInDim closed 6 years ago
Would you please try DATABASE_DATABASE, DATABASE_HOSTNAME, DATABASE_PASSWORD, DATABASE_USERNAME
then tell me tell what happens?
Would you please try
DATABASE_DATABASE, DATABASE_HOSTNAME, DATABASE_PASSWORD, DATABASE_USERNAME
then tell me tell what happens?
Sure, I can try it later today.
But I thought DATABASE_DATABASE, DATABASE_HOSTNAME, DATABASE_PASSWORD, DATABASE_USERNAME
used in case of DB as separate container, isn't it ?
DATABASE_DATABASE
is it name of my local DB, right ?
So I tried :
docker run --name gerrit
docker logs -f gerrit :
ls: /var/gerrit/review_site/git: No such file or directory First time initialize gerrit... [2018-11-06 17:57:57,531] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /var/gerrit/review_site/etc/gerrit.config; assuming defaults Generating SSH host key ... rsa... dsa... ed25519... ecdsa 256... ecdsa 384... ecdsa 521... done Initialized /var/gerrit/review_site
/gerrit-entrypoint.sh: ignoring /docker-entrypoint-init.d/*
Waiting for database connection 127.0.0.1:5432 ...
same result, as early. I have no clue what could be cause of this problem. When I connect to review DB manually as user it's work fine, but from container it's not. Guess cause of this issue DB itself, but can not figure out what\where exactly.
as I thought this issue linked with docker networking;
if add --net=host
key:value param docker-gerrit container successfully connected to local Postgres db.
Now I have another problem with db schema, but it's another separate case, so I do it on my own.
Glad to hear that you have solved this issue. Those DB* environment variables are designed to work with docker --link which is kind of legacy. That's why DATABASE* environment variables are introduced. These environment variables can be used with any kind of external databases, containerized or not.
I trying to start docker-gerrit container with external PostgresDB (running on localhost) and it's only hanging on DB connection nothing more happened.
Doing like :
clone repo; build image from Dockerfile.
run container from image
docker logs -f gerrit
Generating SSH host key ... rsa... dsa... ed25519... ecdsa 256... ecdsa 384... ecdsa 521... done Initialized /var/gerrit/review_site /gerrit-entrypoint.sh: ignoring /docker-entrypoint-init.d/* Waiting for database connection 127.0.0.1:5432...
while DB running on
& has a valid user gerrit2 with password respectively.
Could you give me advice what exactly should I do to run gerrit within container and external existing Postgres DB ? May be I doing something wrong ? Thank you in advance.