首页 > 系统相关 >centos7使用 Docker Engine部署gitlab

centos7使用 Docker Engine部署gitlab

时间:2022-08-14 18:34:11浏览次数:93  
标签:Engine GITLAB -- gitlab publish centos7 HOME docker

1.安装docker-ce

卸载旧版本:

yum remove docker  docker-common docker-selinux docker-engine

一、虚拟机联网,安装yum工具
执行以下命令

yum install -y yum-utils \
devi ce-mapper-pers istent-data \
1vm2 --ski p- broken

二、设置docker镜像源
执行以下命令

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

四、安装docker(网速慢的需要等会)

yum install -y docker-ce

五、启动docker前准备
(docker应用需要用到各种端口,逐一设置比较麻烦,建议直接关闭防火墙) 重要的事请说三遍:启动docker前,一定要关闭防火墙、启动docker前,一定要关闭防火墙、启动docker前,一定要关闭防火墙(关闭前可通过查看查看防火墙状态来检验是否关闭)

#关闭
systemctl stop firewalld
#禁止开机启动防火墙
systemctl disable firewalld

六、启动docker

systemctl start docker
systemctl status docker #查看是否启动成功

2.使用 Docker Engine 安装极狐GitLab

以下内容为官方文档摘抄:https://docs.gitlab.cn/jh/install/docker.html#极狐gitlab-docker-镜像

您可以微调这些目录以满足您的要求。 一旦设置了 GITLAB_HOME 变量,您就可以运行镜像:

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 23:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  --shm-size 256m \
  registry.gitlab.cn/omnibus/gitlab-jh:latest
  # 此处系统端口映射为23是因为ssh连接已经占用了22端口

这将下载并启动极狐GitLab 容器,并发布访问 SSH、HTTP 和 HTTPS 所需的端口。所有极狐GitLab 数据将存储在 $GITLAB_HOME 的子目录中。系统重启后,容器将自动 restart

如果您使用的是 SELinux,请改为运行以下命令:

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 23:22 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab:Z \
  --volume $GITLAB_HOME/logs:/var/log/gitlab:Z \
  --volume $GITLAB_HOME/data:/var/opt/gitlab:Z \
  --shm-size 256m \
  registry.gitlab.cn/omnibus/gitlab-jh:latest
  # 此处系统端口映射为23是因为ssh连接已经占用了22端口

这将确保 Docker 进程有足够的权限在挂载的卷中创建配置文件。

如果您使用 Kerberos 集成 ,您还必须发布您的 Kerberos 端口(例如,--publish 8443:8443)。否则会阻止使用 Kerberos 进行 Git 操作。

初始化过程可能需要很长时间。 您可以通过以下方式跟踪此过程:

sudo docker logs -f gitlab

启动容器后,您可以访问 gitlab.example.com(如果您在 macOS 上使用 boot2docker,则可以访问 http://192.168.59.103)。Docker 容器开始响应查询可能需要一段时间。

访问极狐GitLab URL,并使用用户名 root 和来自以下命令的密码登录:

sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password

标签:Engine,GITLAB,--,gitlab,publish,centos7,HOME,docker
From: https://www.cnblogs.com/ghylpb/p/16585989.html

相关文章

  • 极狐gitlab runner 使用 cache 实例
    极狐gitlabrunner使用cache实例参考官方文档:DockerMachineExecutorautoscaleconfiguration|GitLabCachinginGitLabCI/CD|GitLabSpeedupjobexecutio......
  • centOS7 firewall 防火墙基本操作
    centOS7firewall防火墙基本操作运维家 2022-07-2309:09 发表于北京收录于合集#防火墙1个#linux22个 一、防火墙的开启、关闭、禁用命令 (1)设置开机......
  • 安装MMdetection3D和MinkowskiEngine
    MMdetection3D更新了,只好再次安装,由于CUDA,cuDNN,PyTorch以前已经安装了,这次就不需要安装了,只需要安装MMdetection3D就行了.1. 安装MMCV输入以下命令:pipinstall......
  • centos7搭建bsc全节点
    Centos7搭建bsc全链节点服务器配置 CPU:8Cores-16Threads RAM:131072MB Storage:2x2000GBNVMe Bandwidth:8400.65GBof10000GB OS: CentOS7x64 服务......
  • CentOs7安装node
     1、到node官网下载自己需要的压缩包(https://nodejs.org/zh-cn/download/)下载后按照如下内容安装:[root@localhost~]#tar-zxvf/usr/local/software/node-v14.7.......