Docker部署自己的GitLab

1.拉取镜像

docker pull gitlab/gitlab-ce

2.启动镜像

docker run -it -p8443:443 -p8080:80 -p2222:22 --name gitlab  gitlab/gitlab-ce

3.配置访问gitlab

http://localhost:8080/   设置root密码

 

其它电脑可用IP进行克隆

git clone http://172.20.161.49:8080/root/joint.git

 

-------------------------------分割线-----------------------------

Windows下映射目录没成功,应该是目录权限问题,以后再研究:

docker run -it -p8443:443 -p8080:80 -p2222:22 --name gitlab -v /d/gitlab/config:/etc/gitlab -v /d/gitlab/logs:/var/log/gitlab -v /d/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce

 

Linux下映射目录应该没问题:

--volume /home/brian/gitlab/config:/etc/gitlab
--volume /home/brian/gitlab/logs:/var/log/gitlab
--volume /home/brian/gitlab/data:/var/opt/gitlab

docker run --help

-d, --detach Run container in background and
print container ID

-p, --publish list Publish a container's port(s) to
the host
-P, --publish-all Publish all exposed ports to
random ports
--restart string Restart policy to apply when a
container exits (default "no")

--restart always

参考:
https://www.imooc.com/article/49032
posted @ 2020-05-08 12:04  船长博客  阅读(278)  评论(0编辑  收藏  举报
永远相信美好的事情即将发生!