Docker中安装Gitlab环境

宿主机系统:Centos7

一、下载对应镜像

docker pull sameersbn/gitlab:7.11.2 # 下载gitlab镜像
docker pull sameersbn/mysql:latest # 下载gitlab所用到的mysql镜像
docker pull sameersbn/redis:latest # 下载gitlab所用到的redis镜像

二、安装 & 启动

启动redis

docker run \ --name=gitlab_redis \ -tid \ sameersbn/redis:latest

启动mysql

  1. 创建文件夹 mkdir -p /opt/gitlab/mysql
  2. 启动mysql docker run \ --name=gitlab_mysql \ -tid \ -e 'DB_NAME=gitlabhq_production' \ -e 'DB_USER=gitlab' \ -e 'DB_PASS=password' \ -v /opt/gitlab/mysql:/var/lib/mysql \ sameersbn/mysql:latest

启动gitlab

  1. 创建文件夹 mkdir -p /opt/gitlab/data /opt/gitlab/log
  2. 启动gitlab docker run --name='gitlab' -d \ --link gitlab_mysql:mysql \ --link gitlab_redis:redisio \ -v /opt/gitlab/data:/home/git/data \ -v /opt/gitlab/log:/var/log/gitlab \ -p 10022:22 -p 10080:80 \ -e 'GITLAB_PORT=10080' \ -e 'GITLAB_SSH_PORT=10022' \ sameersbn/gitlab:7.11.2

你可能感兴趣的:(Docker中安装Gitlab环境)