Docker build personal GitLab

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/hk10066/article/details/98039645

 

1 Introduction

GitLab is a warehouse management system for open source projects, using Git as a code management tool, and build up on the basis of web services. Installation is a reference GitLab Wiki's page on GitHub.

Docker is an open source application container engine that lets developers can package their applications and dependencies into a portable mirror, and then publish to any of the popular  Linux on a Windows machine or can be achieved virtualization . The container is full use of the sandbox mechanism will not have any interface with each other.

2. build GitLab

  1. Get gitlab mirror image gitlab-ce
     
    docker search gitlab
  2. Mirror Pull
    docker pull gitlab/gitlab-ce
  3. View Mirror
    docker images
  4. Establish relevant storage folder
    is created under the directory you want to store data
    /usr/local/gitlab/config   配置文件
    /usr/local/gitlab/logs    记录日志
    /usr/local/gitlab/data    存储数据

  5. Boot image
    execute the following command to start gitlab mirror
    first start to use the run command to create a container
    pay attention to your file directory

    docker run --detach --publish 8443:443 --publish 8090:80 --publish 2222:22 --name gitlab --restart always --volume /usr/local/gitlab/config:/etc/gitlab --volume /usr/local/gitlab/logs:/var/log/gitlab --volume /usr/local/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce


    Behind closed when restart can be started directly

    docker start gitlab

     

  6. View Results
    execute the following command to check the container:
    docker ps

    Execute the following command to view the container logs:
    docker logs -f gitlab
  7. 配置账户
    在浏览器中输入网址:http://localhost:8090即可进入gitla页面
    先设置自己的用户密码
    设置好以后就可以直接登陆
    用户名:root
    密码:刚才设置的密码
  8. 完成
    至此已经搭建好自己的gitlab环境了。
  9. 其它
    我自己的ESC(1C2GB)配置太低了,都不敢跑,占内存比较大,建议在高一点配置的服务器上部署
    执行以下命令进入容器:docker exec -it gitlab bash
    
    gitlab配置文件路径:/opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
    
    关闭容器:docker stop gitlab
    

Guess you like

Origin blog.csdn.net/hk10066/article/details/98039645