docker部署gitlab-jenkins-nexus

gitlab

拉取镜像

docker pull docker.m.daocloud.io/gitlab/gitlab-ce:latest

创建挂载目录

mkdir gitlab
cd gitlab
mkdir -p data/log
mkdir -p data/opt
mkdir -p data/etc

启动容器

docker run -itd -p 8443:443 -p 8090:80 -p 8022:22 --name gitlab -v $PWD/data/etc:/etc/gitlab -v $PWD/data/log:/var/log/gitlab -v $PWD/data/opt:/var/opt/gitlab --privileged=true docker.m.daocloud.io/gitlab/gitlab-ce:latest

查找初始账户密码

cd gitlab/data/etc
cat initial_root_password

# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: Vk48/TVa0znqQGJX9v6cd1N9pnuone397PKcW7QnWWU=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.

修改配置gitlab/data/etc/gitlab.rb

external_url 'http://119.45.132.177'
gitlab_rails['gitlab_ssh_host'] = '119.45.132.177'
gitlab_rails['gitlab_shell_ssh_port'] = 8022
#备份相关,路径、权限、保留时间
gitlab_rails['manage_backup_path'] = true             
gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"       
gitlab_rails['backup_archive_permissions'] = 0644      
gitlab_rails['backup_keep_time'] = 5184000 

使配置生效

docker exec -it gitlab bash
gitlab-ctl reconfigure
exit
docker restart gitlab

浏览器登录

输入密码:Vk48/TVa0znqQGJX9v6cd1N9pnuone397PKcW7QnWWU=

修改密码

jenkins

posted @ 2024-08-19 21:05  邹姣姣  阅读(48)  评论(0编辑  收藏  举报