Docker:GitLab

Aus Info-Theke
Version vom 7. März 2018, 13:20 Uhr von Hamatoma (Diskussion | Beiträge)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen


Installation[Bearbeiten]

docker-compose up
CONT=labor_web_1
docker exec -i -t $CONT bash
adduser wk
# Daten eingeben
su wk
ssh-keygen -t rsa -b 4096
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDH6ejWbYoDgg2qAsyS+T7Wk3mmS/USAoM76+9QyUMZMN5SgLXeQ2x9SmIV9ul6rxYvNgSnP243YpfeAvlvMILxzsdG5q0xG33uGYfjHHA2Z74ou2UsK6Yj2thW4d4BtSNK6CJKqIqdWJJvS2GfMQBHOW93m++UjS9e46hzP7MJRf3r3myfPIwiCHGuk2fmeaNqQsFMX/yPUulGAq2DR4gFlh1PESwdn3WwG1Uz+c21B08j8EEefiYZi2XPq2+uCXMBp8hpayLKRLVYXfF8MhT21CmAhmZAtZ0jq7c8YU9hyhrCjPpDy+UecGKz3YdJw7A+HOEdrdgC+ZP31191L0W3 wk@mint18.fn.local' >/home/wk/.ssh/authorized_keys

mkdir -p /etc/ssl/certs/gitlab
cd /etc/ssl/certs/gitlab
openssl genrsa -out server-key.pem 4096
openssl req -new -key server-key.pem -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server-key.pem -out server-cert.pem

Backup[Bearbeiten]

docker exec -t <container name> gitlab-rake gitlab:backup:create

Restore[Bearbeiten]

docker exec -i -t $CONTAINER

gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-ctl status
cp /tmp/gitlab_backup.tar /srv/gitlab/data/backups/1520420181_2018_03_07_10.5.3_gitlab_backup.tar
gitlab-rake gitlab:backup:restore BACKUP=1520420181_2018_03_07_10.5.3