docker中部署gitlab

一、拉取镜像

  • docker pull gitlab/gitlab-ce:latest

二、运行容器

复制代码
docker run --detach \
  --hostname localhost \                  # 本地访问直接用localhost
  --publish 80:80 --publish 443:443 
  --publish 22:22 \              
  --name gitlab \
  --restart unless-stopped \              # 容器退出时不自动重启(生产环境用always)
  --volume $PWD/gitlab/config:/etc/gitlab \
  --volume $PWD/gitlab/logs:/var/log/gitlab \
  --volume $PWD/gitlab/data:/var/opt/gitlab \
  --shm-size 256m \                      # 减少内存占用
  gitlab/gitlab-ce:latest

docker run --detach --hostname localhost --publish 80:80 --publish 443:443 --publish 22:22 --name gitlab --restart unless-stopped --volume $PWD/gitlab/config:/etc/gitlab --volume $PWD/gitlab/logs:/var/log/gitlab --volume $PWD/gitlab/data:/var/opt/gitlab --shm-size 256m gitlab/gitlab-ce:latest

三、获取原始root用户密码

  • docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
相关推荐
cuijiecheng20181 天前
GitLab创建项目
gitlab
啦啦啦小石头1 天前
Docker 换源
docker
等什么君!1 天前
docker -数据卷技术
运维·docker·容器
上天_去_做颗惺星 EVE_BLUE1 天前
Docker高效使用指南:从基础到实战模板
开发语言·ubuntu·docker·容器·mac·虚拟环境
好好沉淀1 天前
Docker开发笔记(详解)
运维·docker·容器
禅口魔心1 天前
Win10 + WSL2 + Docker:K510(DongshanPI-Vision)开发环境从踩坑到跑通全记录(交叉编译 + 上板运行)
docker·嵌入式开发·wsl2·k510
Free Tester2 天前
基于已有容器生成Dockerfile
docker
lcx_defender2 天前
【Docker】Docker部署运行nacos
运维·docker·容器
啦啦啦小石头2 天前
docker添加用户权限不使用sudo
运维·docker·容器
cuber膜拜2 天前
Weaviate 简介与基本使用
数据库·python·docker·向量数据库·weaviate