Comments (8)
@thrisp for linking with postgresql container to work the postgresql server should expose the 5432 port. If it does not, then the container will not be able to figure out the link and will instead start a mysql server internally.
But I don't understand why the mysql server wont start in this case. Can you just try starting the container with
docker run -i -t --rm sameersbn/gitlab:latest
Can you tell me which postgresql container are you using? Can I pull it from the docker index?
from docker-gitlab.
running
docker run -i -t --rm sameersbn/gitlab:latest
seems to run ok; there is a lot of output there that looks like its doing something constructive; however I cannnot connect to the container ip address (in this instance 172.17.42.1) even after 5 minutes post command.
postgres image is:
orchardup/postgresql:latest
run with:
sudo docker run -d --name pgdatalocal -p 127.0.0.1:5432:5432 -v /opt/postgresql:/var/lib/postgresql orchardup/postgresql
from docker-gitlab.
seems to run ok; there is a lot of output there that looks like its doing something constructive; however I cannnot connect to the container ip address (in this instance 172.17.42.1) even after 5 minutes post command.
172.17.42.1 seems like its the host ip of the docker0 interface and not the ip address of the container. please check.
I will try using the orchardup/postgresql:latest
image and get back with you.
from docker-gitlab.
@thrisp I tried the orchardup/postgresql and had not issues using it.
Start postgresql container with a user and database for gitlab
mkdir -p /opt/postgresql
docker run -d --name pgdatalocal -v /opt/postgresql:/var/lib/postgresql \
-e "POSTGRESQL_USER=gitlab" -e "POSTGRESQL_PASS=password" \
-e "POSTGRESQL_DB=gitlabhq_production" orchardup/postgresql
Start gitlab setup with the postgresql container linked
docker run -i -t --rm --name=gitlab --link pgdatalocal:postgresql \
-v /opt/gitlab:/home/git/data \
-e "DB_USER=gitlab" -e "DB_PASS=password" -e "DB_NAME=gitlabhq_production" \
sameersbn/gitlab:latest app:rake gitlab:setup
Now start the gitlab application
docker run -i -t --rm --name=gitlab --link pgdatalocal:postgresql \
-v /opt/gitlab:/home/git/data \
-e "DB_USER=gitlab" -e "DB_PASS=password" -e "DB_NAME=gitlabhq_production" \
sameersbn/gitlab:latest
Launch the web browser.
GITLAB_IP=$(docker inspect gitlab | grep IPAddres | awk -F'"' '{print $4}')
xdg-open "http://${GITLAB_IP}"
However, please note that gitlab restore does not seem to be working when using a linked postgresql server. For example,
Creating a backup works.
docker run -i -t --rm --name=gitlab --link pgdatalocal:postgresql \
-v /opt/gitlab:/home/git/data \
-e "DB_USER=gitlab" -e "DB_PASS=password" -e "DB_NAME=gitlabhq_production" \
sameersbn/gitlab:latest app:rake gitlab:backup:create
Restoring a backup takes dump while your watching...
docker run -i -t --rm --name=gitlab --link pgdatalocal:postgresql \
-v /opt/gitlab:/home/git/data \
-e "DB_USER=gitlab" -e "DB_PASS=password" -e "DB_NAME=gitlabhq_production" \
sameersbn/gitlab:latest app:rake gitlab:backup:restore
Unpacking backup ... done
Restoring database ...
Restoring PostgreSQL database gitlabhq_production ... [FAILED]
done
Restoring repositories ...
rake aborted!
PG::Error: ERROR: relation "projects" does not exist
LINE 1: SELECT "projects".* FROM "projects" ORDER BY "projects"."...
^
: SELECT "projects".* FROM "projects" ORDER BY "projects"."id" ASC LIMIT 1000
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:774:in `exec'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:774:in `exec_no_cache'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:138:in `block in exec_query'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:435:in `block in log'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:430:in `log'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:137:in `exec_query'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:891:in `select'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:24:in `select_all'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/querying.rb:36:in `find_by_sql'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/relation.rb:585:in `exec_queries'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/relation.rb:471:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/relation.rb:220:in `to_a'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/relation/batches.rb:69:in `find_in_batches'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-deprecated_finders-1.0.3/lib/active_record/deprecated_finders/relation.rb:70:in `find_in_batches'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/relation/batches.rb:25:in `find_each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.3/lib/active_record/querying.rb:8:in `find_each'
/home/git/gitlab/lib/backup/repository.rb:51:in `restore'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:45:in `block (4 levels) in <top (required)>'
/home/git/gitlab/lib/tasks/gitlab/backup.rake:29:in `block (3 levels) in <top (required)>'
Tasks: TOP => gitlab:backup:repo:restore
(See full trace by running task with --trace)
Now I don't know whether this is an issue with
- using postgresql in a container
- using postgresql in general
- some configuration issue for the postgresql user, given my inexperience with using postgresql
- some postgresql support issue in gitlab
- or something else
I have tried various postgresql containers and all exhibit the same behaviour. The postgresql images i tried include:
- sameersbn/postgresql
- paintedfox/postgresql
- orchardup/postgresql
Nothing seems to work when trying to restore a gitlab backup.
from docker-gitlab.
@thrisp I think I know why restore is not working when a postgresql server is used. Basically the postgresql-client package needs to be installed in the gitlab container.
I will add that and check.
from docker-gitlab.
@thrisp yup, that was the cause of the restore operation not working when postgresql was used. fixed in fc0a6d1
from docker-gitlab.
I'm still new to using Docker, but as for starting I'm able to use the latest image with a postgresql container, the dev container I have.
from docker-gitlab.
thank you
from docker-gitlab.
Related Issues (20)
- ENOENT: No such file or directory HOT 4
- problem deleting image or tag 16.6.1 HOT 13
- 16.7.0: Rake aborts launch with "failed to get urandom" HOT 36
- Migrate gitlab 11.10.4 to gitlab 16.6.2 with mysql to postgresql
- Error fetching repo data HOT 1
- CVE-2023-7028 HOT 3
- Upgrade Ruby to 3.2.x to remove bug introduced on Ruby 3.1.x HOT 4
- Unable to fetch commit when using --depth 1 mode
- GitLab Critical Security Release: 16.8.1, 16.7.4, 16.6.6, 16.5.8 HOT 1
- How to backup GitLab in Kubernetes? Do you have any good ideas, templates, or documentation? I'm not very familiar with Kubernetes, so please help me. HOT 2
- Backups not functioning in v16.8.1 HOT 3
- [Question] How to change the clone link from localhost to my domain? HOT 2
- Support setting `global_time_tracking_report` HOT 1
- I have set up an auto-backup strategy in Kubernetes, but it seems not to take effect. How can I troubleshoot the problem? HOT 9
- How is openid_connect_signing_key handled? HOT 1
- level=error correlation_id= duration_ms=0 error="badgateway: failed to receive response: dial unix /home/git/gitlab/tmp/sockets/gitlab.socket: connect: no such file or directory
- Please support pages namespace_in_path
- Web log-in broken HOT 2
- missing 16.1.6 and 16.3.7 version needed for upgrade path HOT 14
- postgres (PostgreSQL) 15.1 (Debian 15.1-1.pgdg110+1) image no longer exists HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-gitlab.