diff options
author | Sytse Sijbrandij <sytses@gmail.com> | 2014-12-02 19:16:46 +0300 |
---|---|---|
committer | Sytse Sijbrandij <sytses@gmail.com> | 2014-12-02 19:16:46 +0300 |
commit | 3b643bc87ba126e00550e6a067e4327020452a1b (patch) | |
tree | e247ffeb70b46a1655634195cfb4d5664516ecb8 /docker/troubleshooting.md | |
parent | 6f9d9ea09ead63bbed43b94f57edf5e05ade661c (diff) |
Move build to first step and add interactive commands.
Diffstat (limited to 'docker/troubleshooting.md')
-rw-r--r-- | docker/troubleshooting.md | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/docker/troubleshooting.md b/docker/troubleshooting.md index e2717a13b4a..deab144841c 100644 --- a/docker/troubleshooting.md +++ b/docker/troubleshooting.md @@ -8,10 +8,12 @@ postgresql['log_directory'] = '/var/log/gitlab/postgresql' # Commands +```bash +sudo docker build --tag gitlab_image docker/ + sudo docker rm -f gitlab sudo docker rm -f gitlab_data -sudo docker build --tag gitlab_image docker/ sudo docker run --name gitlab_data gitlab_image /bin/true sudo docker run -ti --rm --volumes-from gitlab_data ubuntu apt-get update && sudo apt-get install -y vim && sudo vim /etc/gitlab/gitlab.rb @@ -23,3 +25,27 @@ sudo docker run -t --rm --volumes-from gitlab_data ubuntu tail -f /var/log/gitla sudo docker run -t --rm --volumes-from gitlab_data ubuntu tail -f /var/log/gitlab/postgresql/current sudo docker run -ti --rm --volumes-from gitlab_data ubuntu /bin/sh +``` + +# Interactively + +```bash +# First start a GitLab container without starting GitLab +# This is almost the same as starting the GitLab container except: +# - we run interactively (-t -i) +# - we define TERM=linux because it allows to use arrow keys in vi (!!!) +# - we choose another startup command (bash) +sudo docker run -ti -e TERM=linux --name gitlab --publish 8080:80 --publish 2222:22 --volumes-from gitlab_data gitlab_image bash + +# Configure GitLab to redirect PostgreSQL logs +echo "postgresql['log_directory'] = '/var/log/gitlab/postgresql'" >> /etc/gitlab/gitlab.rb + +# You can now start GitLab manually from Bash (in the background) +gitlab-ctl reconfigure > /var/log/gitlab/reconfigure.log & /opt/gitlab/embedded/bin/runsvdir-start & + +# And tail the logs (PostgreSQL log may not exist immediately) +tail -f /var/log/gitlab/reconfigure.log /var/log/gitlab/postgresql/current + +# And get the memory +cat /proc/meminfo +``` |