3-13 2,040 views
命令安装
启动命令
docker run --detach \
--hostname 127.0.0.1 \
--publish 8181:8181 \
--name gitlab \
--restart always \
--volume /apps/docker/gitlab/config:/etc/gitlab \
--volume /apps/docker/gitlab/logs:/var/log/gitlab \
--volume /apps/docker/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
docker compose 方式
#docker-compose.yml
gitlab:
image: 'gitlab/gitlab-ce:latest'
container_name: gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://git.blackmatch.cn'
# email setting
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "my.email@gmail.com"
gitlab_rails['smtp_password'] = "my-gmail-password"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
ports:
- '8181:8181'
volumes:
- './config:/etc/gitlab'
- './logs:/var/log/gitlab'
- './data:/var/opt/gitlab'
restart: always