Zum Hauptinhalt springen

Installation von Gitlab

Gitlab installieren

Im folgenden wird Gitlab mit Hilfe von docker-compose installiert. Eine Anleitung dazu befindet sich im Bereich Docker.

sudo mkdir /srv/gitlab
# change owner of the dir
sudo chown $USER /srv/gitlab/
# create gitlab folder
mkdir -p /srv/gitlab/{config/ssl,logs,data}
# create env file for docker
echo "GITLAB_HOME=/srv/gitlab" > .env
# create docker-compose file
touch docker-compose.yml

# Put in the following in the docker-compose file
version: '3.6'
services:
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'ubuntu-server-test'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://ubuntu-server-test'
# Add any other gitlab.rb configuration here, each on its own line
gitlab_rails['gitlab_shell_ssh_port'] = 2222
ports:
- '80:80'
- '443:443'
- '2222:22'

volumes:
- '${GITLAB_HOME}/config:/etc/gitlab'
- '${GITLAB_HOME}/logs:/var/log/gitlab'
- '${GITLAB_HOME}/data:/var/opt/gitlab'

Gitlab starten

docker-compose up -d

Passwort setzen

# connect to docker container
docker exec -it gitlab_web_1 /bin/bash
# reset password
gitlab-rake "gitlab:password:reset"
# user: root
# password: Your new Password

Kommentare