1 docker run -d -p 8443:443 -p 8081:80 -p 8022:22 \
2 --name gitlab --restart always \
3 --volume /home/xxx/dockerData/gitlab/config:/etc/gitlab \
4 --volume /home/xxx/dockerData/gitlab/logs:/var/log/gitlab \
5 --volume /home/xxx/dockerData/gitlab/data:/var/opt/gitlab \
6 gitlab/gitlab-ce:latest

或者

1 vim /etc/default/docker #然后修改其中的DOCKER_OPTS
2 # Use DOCKER_OPTS to modify the daemon startup options.
3 DOCKER_OPTS="--registry-mirror=https://dg9t1zch.mirror.aliyuncs.com" # 改地址为阿里云给我的镜像加速器地址
1 docker run --detach \
2     --publish 443:443 --publish 10080:80 --publish 22:22 \
3     --name gitlab \
4     --restart always \
5     --volume /srv/gitlab/config:/etc/gitlab \
6     --volume /srv/gitlab/logs:/var/log/gitlab \
7     --volume /srv/gitlab/data:/var/opt/gitlab \
8     twang2218/gitlab-ce-zh:latest  # 该镜像是aliyun上的一个镜像,地址https://cr.console.aliyun.com/#/imageDesc/cn-hangzhou/lab99/gitlab-ce-zh/detail
由于SSH端口和这里的22端口可能会有冲突,导致连接不上去,因此设置ssh端口为别的端口就可以了

vim /etc/ssh/sshd_config # 找到里边对应的Port,将22修改为20343或别的端口

 

相关文章:

  • 2022-12-23
  • 2021-10-11
  • 2021-08-31
  • 2021-09-20
  • 2021-07-17
  • 2021-06-04
  • 2021-10-20
  • 2021-12-07
猜你喜欢
  • 2021-07-13
  • 2021-11-25
  • 1970-01-01
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案