安装步骤

1.获取gitLab安装包 地址:https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/bionic/gitlab-ce_14.5.0-ce.0_amd64.deb/download.deb 下载好安装包,将镜像放到Dockerfile目录下 2.拉去Ubuntu镜像 docker pull ubuntu:18.04 3.编写Dockerfile

From ubuntu:18.04

LABEL maintainer="Shayne <15773001203@163.com>"

USER root

RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \

sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \

sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \

apt-get update && \

apt-get upgrade -y && \

apt-get install -y --no-install-recommends \

openssh-server \

curl \

zip \

unzip \

git \

vim \

tzdata \

wget

USER root

ADD gitlab-ce_14.5.0-ce.0_amd64.deb /opt

USER root

RUN dpkg -i /opt/gitlab-ce_14.5.0-ce.0_amd64.deb

EXPOSE 9999

3.构建镜像,在Dockerfile目录下执行构建命令 docker build -t gitlab:1.0 . 4.运行镜像 docker run -itd --name gitlab -v ./config:/etc/gitlab/gitlab.rb -p 9999:9999 gitlab:1.0 5.修改gitlab.rb,将external_url的值修改未 http://localhost:9999 6.运行gitlab-ctl reconfigure 7. gitlab-ctl restart 重启服务

问题

1.在执行gitlab-ctl reconfigure 过程中也许会碰到ruby_block[wait for redis service socket 可以开启另外一个客户端,执行

nohup /opt/gitlab/embedded/bin/runsvdir-start &

2.重启服务的gitlab服务,也许会碰到 fail 各种服务 //也是需要先执行nohup /opt/gitlab/embedded/bin/runsvdir-start & 再执行 gitlab-ctl restart

推荐链接

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。