docker升级gitlab/gitlab-ce:11.7.5-ce.0到gitlab/gitlab-ce:12.1.0-ce.0
官方给出的解决办法:
11.7.5-->11.11.5-->12.1.0
docker-compose.yaml文件如下
version: '3.0'
services:
gitlab:
container_name: gitlab
image: gitlab/gitlab-ce:11.7.5-ce.0
# 数据恢复后,先停止gitlab
#进行第一次升级,升级到主版本最高次版本(可在docker hub网站查找)
# image: gitlab/gitlab-ce:11.11.5-ce.0
#升级到次版本最高,停止gitlab,升级到最高版本
# image: gitlab/gitlab-ce:12.1.0-ce.0
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://10.0.0.3:81'
ports:
- '81:81'
- '443:433'
- '2224:22'
volumes:
- /opt/gitlab/config:/etc/gitlab
- /opt/gitlab/logs:/var/log/gitlab
- /opt/gitlab/data:/var/opt/gitlab
networks:
- gitlab_net
networks:
gitlab_net:
gitlab数据备份
gitlab-rake gitlab:backup:create
gitlab数据恢复
gitlab-rake gitlab:backup:restore BACKUP=1563909349_2019_07_23_11.7.5
停止gitlab
docker-compose down
修改gitlab密码
gitlab-rails console production
user = User.where(id:1).first
user.password='123456'
user.save
gitlab升级
docker-compose up -d