# Building Docker images with GitLab CI/CD
> 原文:[https://docs.gitlab.com/ee/ci/docker/using_docker_build.html](https://docs.gitlab.com/ee/ci/docker/using_docker_build.html)
* [Runner Configuration](#runner-configuration)
* [Use shell executor](#use-shell-executor)
* [Use Docker-in-Docker workflow with Docker executor](#use-docker-in-docker-workflow-with-docker-executor)
* [TLS enabled](#tls-enabled)
* [TLS disabled](#tls-disabled)
* [Use Docker socket binding](#use-docker-socket-binding)
* [Making Docker-in-Docker builds faster with Docker layer caching](#making-docker-in-docker-builds-faster-with-docker-layer-caching)
* [How Docker caching works](#how-docker-caching-works)
* [Using Docker caching](#using-docker-caching)
* [Use the OverlayFS driver](#use-the-overlayfs-driver)
* [Requirements](#requirements)
* [Use the OverlayFS driver per project](#use-the-overlayfs-driver-per-project)
* [Use the OverlayFS driver for every project](#use-the-overlayfs-driver-for-every-project)
* [Using the GitLab Container Registry](#using-the-gitlab-container-registry)
* [Troubleshooting](#troubleshooting)
* [`docker: Cannot connect to the Docker daemon at tcp://docker:2375\. Is the docker daemon running?`](#docker-cannot-connect-to-the-docker-daemon-at-tcpdocker2375-is-the-docker-daemon-running)
# Building Docker images with GitLab CI/CD[](#building-docker-images-with-gitlab-cicd "Permalink")
GitLab CI / CD 允許您使用 Docker Engine 來構建和測試基于 Docker 的項目.
持續集成/部署中的新趨勢之一是:
1. Create an application image.
2. 針對創建的圖像運行測試.
3. 將映像推送到遠程注冊表.
4. 從推送的映像部署到服務器.
當您的應用程序已經具有可用于創建和測試映像的`Dockerfile` ,它也很有用:
```
docker build -t my-image dockerfiles/
docker run my-image /script/to/run/tests
docker tag my-image my-registry:5000/my-image
docker push my-registry:5000/my-image
```
這需要對 GitLab Runner 進行特殊配置才能在作業期間啟用`docker`支持.
## Runner Configuration[](#runner-configuration "Permalink")
有三種方法可在作業期間啟用`docker build`和`docker run`的使用: 每個都有自己的權衡.
[使用 docker](using_kaniko.html) `docker build`的替代方法是[使用 kaniko](using_kaniko.html) . 這避免了必須在特權模式下執行 Runner.
**提示:**要了解如何在 GitLab.com 上為共享的 Runner 配置 Docker 和 Runner,請參閱[GitLab.com 的共享的 Runners](../../user/gitlab_com/index.html#shared-runners) .
### Use shell executor[](#use-shell-executor "Permalink")
最簡單的方法是在`shell`執行模式下安裝 GitLab Runner. 然后,GitLab Runner 以`gitlab-runner`用戶身份執行作業腳本.
1. Install [GitLab Runner](https://gitlab.com/gitlab-org/gitlab-runner/#installation).
2. 在 GitLab Runner 安裝過程中,選擇`shell`作為執行作業腳本的方法或使用命令:
```
sudo gitlab-runner register -n \
--url https://gitlab.com/ \
--registration-token REGISTRATION_TOKEN \
--executor shell \
--description "My Runner"
```
3. 在服務器上安裝 Docker Engine.
有關如何在不同系統上安裝 Docker Engine 的更多信息,請查看[支持的安裝](https://s0docs0docker0com.icopy.site/engine/installation/) .
4. Add `gitlab-runner` user to `docker` group:
```
sudo usermod -aG docker gitlab-runner
```
5. 確認`gitlab-runner`有權訪問 Docker:
```
sudo -u gitlab-runner -H docker info
```
現在,您可以通過將`.gitlab-ci.yml` `docker info`添加到`.gitlab-ci.yml`來驗證一切正常:
```
before_script:
- docker info
build_image:
script:
- docker build -t my-docker-image .
- docker run my-docker-image /script/to/run/tests
```
6. 您現在可以使用`docker`命令(并在需要時**安裝** `docker-compose` ).
**注:**通過添加`gitlab-runner`的`docker`您可以有效地授予組`gitlab-runner`完整的 root 權限. 有關更多信息,請閱讀[關于 Docker 安全性: `docker` group 認為是有害的](https://www.andreas-jung.com/contents/on-docker-security-docker-group-considered-harmful) .
### Use Docker-in-Docker workflow with Docker executor[](#use-docker-in-docker-workflow-with-docker-executor "Permalink")
第二種方法是使用特殊泊塢窗功能于泊塢(DIND) [泊塢窗圖像](https://hub.docker.com/_/docker/)安裝(所有工具`docker` ),并在特權模式圖像的上下文中運行作業腳本.
**注意:** `docker-compose`不是 Docker-in-Docker(dind)的一部分. 要在 CI 構建中使用`docker-compose` ,請遵循`docker-compose` [安裝說明](https://s0docs0docker0com.icopy.site/compose/install/) .**危險:**通過啟用`--docker-privileged` ,可以有效地禁用容器的所有安全機制,并使主機暴露于特權升級之下,這可能導致容器突破. 有關更多信息,請查看有關[運行時特權和 Linux 功能](https://s0docs0docker0com.icopy.site/engine/reference/run/)的官方 Docker 文檔.
Docker-in-Docker 運作良好,是推薦的配置,但并非沒有挑戰:
* When using Docker-in-Docker, each job is in a clean environment without the past history. Concurrent jobs work fine because every build gets its own instance of Docker engine so they won’t conflict with each other. But this also means that jobs can be slower because there’s no caching of layers.
* 默認情況下,Docker 17.09 及更高版本使用`--storage-driver overlay2` ,這是推薦的存儲驅動程序. 有關詳細信息,請參見[使用 overlayfs 驅動程序](#use-the-overlayfs-driver) .
* 由于`docker:19.03.12-dind`容器和 Runner 容器不共享其根文件系統,因此作業的工作目錄可用作子容器的安裝點. 例如,如果您有要與子容器共享的文件,則可以在`/builds/$CI_PROJECT_PATH`下創建一個子目錄,并將其用作安裝點(有關更詳盡的解釋,請[參見問題#41227](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/41227) ):
```
variables:
MOUNT_POINT: /builds/$CI_PROJECT_PATH/mnt
script:
- mkdir -p "$MOUNT_POINT"
- docker run -v "$MOUNT_POINT:/mnt" my-docker-image
```
可在以下位置找到使用此方法的示例項目: [https](https://gitlab.com/gitlab-examples/docker) : [//gitlab.com/gitlab-examples/docker](https://gitlab.com/gitlab-examples/docker) .
在以下示例中,我們使用 Docker images 標簽指定特定版本,例如`docker:19.03.12` . 如果使用了諸如`docker:stable`類的標簽,則您將無法控制要使用的版本,這可能導致無法預測的行為,尤其是在發布新版本時.
#### TLS enabled[](#tls-enabled "Permalink")
**注意:**需要 GitLab Runner 11.11 或更高版本,但是如果使用[Helm chart](https://docs.gitlab.com/runner/install/kubernetes.html)安裝了 GitLab Runner,則不支持. 有關詳細信息,請參見[相關問題](https://gitlab.com/gitlab-org/charts/gitlab-runner/-/issues/83) .
Docker 守護程序支持通過 TLS 的連接,默認情況下,對于 Docker 19.03.12 或更高版本,它已完成. 這是使用 Docker-in-Docker 服務的**建議**方法, [GitLab.com 共享運行程序](../../user/gitlab_com/index.html#shared-runners)支持此方法.
1. Install [GitLab Runner](https://docs.gitlab.com/runner/install/).
2. 從命令行注冊 GitLab Runner 以使用`docker`和`privileged`模式:
```
sudo gitlab-runner register -n \
--url https://gitlab.com/ \
--registration-token REGISTRATION_TOKEN \
--executor docker \
--description "My Docker Runner" \
--docker-image "docker:19.03.12" \
--docker-privileged \
--docker-volumes "/certs/client"
```
上面的命令將注冊一個新的 Runner 以使用由 Docker 提供的特殊`docker:19.03.12`映像. **注意,它使用`privileged`模式來啟動構建和服務容器.** 如果要使用[Docker-in-Docker](https://www.docker.com/blog/docker-can-now-run-within-docker/)模式,則始終必須在 Docker 容器中使用`privileged = true` .
這還將為服務安裝`/certs/client`并構建容器,這是 Docker 客戶端使用該目錄內的證書所必需的. 有關更多信息,請參閱[https://hub.docker.com/_/docker/#tls](https://hub.docker.com/_/docker/#tls) .
上面的命令將創建一個類似于以下內容的`config.toml`條目:
```
[[runners]]
url = "https://gitlab.com/"
token = TOKEN
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:19.03.12"
privileged = true
disable_cache = false
volumes = ["/certs/client", "/cache"]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
```
3. 您現在可以使用`docker`在構建腳本(注意列入`docker:19.03.12-dind`服務):
```
image: docker:19.03.12
variables:
# When using dind service, we need to instruct docker, to talk with
# the daemon started inside of the service. The daemon is available
# with a network connection instead of the default
# /var/run/docker.sock socket. Docker 19.03 does this automatically
# by setting the DOCKER_HOST in
# https://github.com/docker-library/docker/blob/d45051476babc297257df490d22cbd806f1b11e4/19.03/docker-entrypoint.sh#L23-L29
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services.
#
# Note that if you're using GitLab Runner 12.7 or earlier with the Kubernetes executor and Kubernetes 1.6 or earlier,
# the variable must be set to tcp://localhost:2376 because of how the
# Kubernetes executor connects services to the job container
# DOCKER_HOST: tcp://localhost:2376
#
# Specify to Docker where to create the certificates, Docker will
# create them automatically on boot, and will create
# `/certs/client` that will be shared between the service and job
# container, thanks to volume mount from config.toml
DOCKER_TLS_CERTDIR: "/certs"
services:
- docker:19.03.12-dind
before_script:
- docker info
build:
stage: build
script:
- docker build -t my-docker-image .
- docker run my-docker-image /script/to/run/tests
```
#### TLS disabled[](#tls-disabled "Permalink")
有時出于某些合理原因,您可能想要禁用 TLS. 例如,您無法控制所使用的 GitLab Runner 配置.
假設 Runner `config.toml`類似于:
```
[[runners]]
url = "https://gitlab.com/"
token = TOKEN
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:19.03.12"
privileged = true
disable_cache = false
volumes = ["/cache"]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
```
您現在可以使用`docker`在構建腳本(注意列入`docker:19.03.12-dind`服務):
```
image: docker:19.03.12
variables:
# When using dind service we need to instruct docker, to talk with the
# daemon started inside of the service. The daemon is available with
# a network connection instead of the default /var/run/docker.sock socket.
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
#
# Note that if you're using GitLab Runner 12.7 or earlier with the Kubernetes executor and Kubernetes 1.6 or earlier,
# the variable must be set to tcp://localhost:2375 because of how the
# Kubernetes executor connects services to the job container
# DOCKER_HOST: tcp://localhost:2375
#
DOCKER_HOST: tcp://docker:2375
#
# This will instruct Docker not to start over TLS.
DOCKER_TLS_CERTDIR: ""
services:
- docker:19.03.12-dind
before_script:
- docker info
build:
stage: build
script:
- docker build -t my-docker-image .
- docker run my-docker-image /script/to/run/tests
```
### Use Docker socket binding[](#use-docker-socket-binding "Permalink")
第三種方法是將`/var/run/docker.sock`綁定安裝到容器中,以便 Docker 在該映像的上下文中可用.
**注意:**如果[在使用 GitLab Runner 11.11 或更高版本時](https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/1261)綁定 Docker 套接字,則不能再將`docker:19.03.12-dind`用作服務,因為對服務也進行了卷綁定,從而使它們不兼容.
為此,請按照下列步驟操作:
1. Install [GitLab Runner](https://docs.gitlab.com/runner/install/).
2. 從命令行注冊 GitLab Runner 以使用`docker`并共享`/var/run/docker.sock` :
```
sudo gitlab-runner register -n \
--url https://gitlab.com/ \
--registration-token REGISTRATION_TOKEN \
--executor docker \
--description "My Docker Runner" \
--docker-image "docker:19.03.12" \
--docker-volumes /var/run/docker.sock:/var/run/docker.sock
```
上面的命令將注冊一個新的 Runner 以使用由 Docker 提供的特殊`docker:19.03.12`映像. **請注意,它使用的是 Runner 本身的 Docker 守護進程,并且 Docker 命令產生的任何容器都將是 Runner 的兄弟,而不是 Runner 的子代.** 這可能會帶來一些不適合您的工作流程的復雜性和局限性.
上面的命令將創建一個類似于以下內容的`config.toml`條目:
```
[[runners]]
url = "https://gitlab.com/"
token = REGISTRATION_TOKEN
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:19.03.12"
privileged = false
disable_cache = false
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
[runners.cache]
Insecure = false
```
3. 您現在可以使用`docker`在構建腳本(請注意,您不需要包括`docker:19.03.12-dind`服務泊塢執行使用泊塢時):
```
image: docker:19.03.12
before_script:
- docker info
build:
stage: build
script:
- docker build -t my-docker-image .
- docker run my-docker-image /script/to/run/tests
```
盡管上述方法避免在特權模式下使用 Docker,但您應注意以下含義:
* 通過共享 Docker 守護程序,您可以有效地禁用容器的所有安全機制,并使主機暴露于特權升級之下,這可能導致容器突破. 例如,如果一個項目運行`docker rm -f $(docker ps -a -q)` ,它將刪除 GitLab Runner 容器.
* 并發工作可能無法正常工作; 如果您的測試創建了具有特定名稱的容器,則它們可能會相互沖突.
* 將源倉庫中的文件和目錄共享到容器中可能無法正常工作,因為卷安裝是在主機而不是構建容器的上下文中完成的. 例如:
```
docker run --rm -t -i -v $(pwd)/src:/home/app/src test-image:latest run_app_tests
```
## Making Docker-in-Docker builds faster with Docker layer caching[](#making-docker-in-docker-builds-faster-with-docker-layer-caching "Permalink")
在使用 Docker-in-Docker 時,每次創建構建時 Docker 都會下載映像的所有層. 最新版本的 Docker(Docker 1.13 及更高版本)可以在 Docker `docker build`步驟中使用預先存在的映像作為緩存,從而大大加快了構建過程.
### How Docker caching works[](#how-docker-caching-works "Permalink")
運行`Dockerfile` `docker build` , `Dockerfile`中的每個命令`Dockerfile`一個圖層. 這些層保留為高速緩存,如果沒有任何更改,可以重復使用. 一層中的更改將導致重新創建所有后續層.
您可以使用`--cache-from`參數指定標記的圖像用作`--cache-from` `docker build`命令的緩存源. 可以使用多個`--cache-from`參數將多個圖像指定為緩存源. 請記住,與`--cache-from`參數一起使用的任何映像都必須先被拉出(使用`docker pull` ),然后才能用作緩存源.
### Using Docker caching[](#using-docker-caching "Permalink")
這是一個`.gitlab-ci.yml`文件,顯示了如何使用 Docker 緩存:
```
image: docker:19.03.12
services:
- docker:19.03.12-dind
variables:
# Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
DOCKER_HOST: tcp://docker:2376
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build:
stage: build
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:latest
```
`build`階段的`script`部分中的步驟可以總結為:
1. 第一個命令嘗試從注冊表中提取映像,以便將其用作`docker build`命令的緩存.
2. 第二個命令使用拉取的映像作為緩存來構建 Docker 映像(請注意`--cache-from $CI_REGISTRY_IMAGE:latest`參數),并對其進行標記.
3. 最后兩個命令將標記的 Docker 映像推送到容器注冊表,以便它們也可用作后續構建的緩存.
## Use the OverlayFS driver[](#use-the-overlayfs-driver "Permalink")
**注意:**默認情況下,GitLab.com 上的共享 Runners 使用`overlay2`驅動程序.
默認情況下,使用`docker:dind` ,Docker 使用`vfs`存儲驅動程序,該驅動程序會在每次運行時復制文件系統. 這是磁盤密集型操作,如果使用其他驅動程序(例如`overlay2` ,則可以避免.
### Requirements[](#requirements "Permalink")
1. 確保使用最新內核,最好`>= 4.2` .
2. 檢查是否已加載`overlay`模塊:
```
sudo lsmod | grep overlay
```
如果看不到任何結果,則說明未加載. 要加載它,請使用:
```
sudo modprobe overlay
```
如果一切正常,則需要確保模塊在重新啟動時已加載. 在 Ubuntu 系統上,這是通過編輯`/etc/modules` . 只需將以下行添加到其中:
```
overlay
```
### Use the OverlayFS driver per project[](#use-the-overlayfs-driver-per-project "Permalink")
您可以使用`.gitlab-ci.yml`的`DOCKER_DRIVER`環境[變量](../yaml/README.html#variables)分別為每個項目啟用驅動程序:
```
variables:
DOCKER_DRIVER: overlay2
```
### Use the OverlayFS driver for every project[](#use-the-overlayfs-driver-for-every-project "Permalink")
如果使用自己的[GitLab Runners](https://docs.gitlab.com/runner/) ,則可以通過在[`config.toml`](https://docs.gitlab.com/runner/configuration/advanced-configuration.html)的[`[[runners]]`部分中](https://docs.gitlab.com/runner/configuration/advanced-configuration.html)設置`DOCKER_DRIVER`環境變量來為每個項目啟用驅動程序:
```
environment = ["DOCKER_DRIVER=overlay2"]
```
如果您正在運行多個運行程序,則必須修改所有配置文件.
**注意:**閱讀有關[Runner 配置](https://docs.gitlab.com/runner/configuration/)和[使用 OverlayFS 存儲驅動程序的更多信息](https://s0docs0docker0com.icopy.site/engine/userguide/storagedriver/overlayfs-driver/) .
## Using the GitLab Container Registry[](#using-the-gitlab-container-registry "Permalink")
構建 Docker 映像后,可以將其推送到內置的[GitLab Container Registry 中](../../user/packages/container_registry/index.html#build-and-push-images-using-gitlab-cicd) .
## Troubleshooting[](#troubleshooting "Permalink")
### `docker: Cannot connect to the Docker daemon at tcp://docker:2375\. Is the docker daemon running?`[](#docker-cannot-connect-to-the-docker-daemon-at-tcpdocker2375-is-the-docker-daemon-running "Permalink")
[在 Docker](#use-docker-in-docker-workflow-with-docker-executor) v19.03 或更高版本中使用[Docker](#use-docker-in-docker-workflow-with-docker-executor)時,這是一個常見錯誤.
發生這種情況是因為 Docker 自動在 TLS 上啟動,因此您需要進行一些設置. 如果:
* 這是第一次設置,請[在 Docker 工作流程中使用 Docker](#use-docker-in-docker-workflow-with-docker-executor)仔細閱讀.
* 您要從 v18.09 或更早版本[升級](https://about.gitlab.com/releases/2019/07/31/docker-in-docker-with-docker-19-dot-03/) ,請閱讀我們的[升級指南](https://about.gitlab.com/releases/2019/07/31/docker-in-docker-with-docker-19-dot-03/) .
- GitLab Docs
- Installation
- Requirements
- GitLab cloud native Helm Chart
- Install GitLab with Docker
- Installation from source
- Install GitLab on Microsoft Azure
- Installing GitLab on Google Cloud Platform
- Installing GitLab on Amazon Web Services (AWS)
- Analytics
- Code Review Analytics
- Productivity Analytics
- Value Stream Analytics
- Kubernetes clusters
- Adding and removing Kubernetes clusters
- Adding EKS clusters
- Adding GKE clusters
- Group-level Kubernetes clusters
- Instance-level Kubernetes clusters
- Canary Deployments
- Cluster Environments
- Deploy Boards
- GitLab Managed Apps
- Crossplane configuration
- Cluster management project (alpha)
- Kubernetes Logs
- Runbooks
- Serverless
- Deploying AWS Lambda function using GitLab CI/CD
- Securing your deployed applications
- Groups
- Contribution Analytics
- Custom group-level project templates
- Epics
- Manage epics
- Group Import/Export
- Insights
- Issues Analytics
- Iterations
- Public access
- SAML SSO for GitLab.com groups
- SCIM provisioning using SAML SSO for GitLab.com groups
- Subgroups
- Roadmap
- Projects
- GitLab Secure
- Security Configuration
- Container Scanning
- Dependency Scanning
- Dependency List
- Static Application Security Testing (SAST)
- Secret Detection
- Dynamic Application Security Testing (DAST)
- GitLab Security Dashboard
- Offline environments
- Standalone Vulnerability pages
- Security scanner integration
- Badges
- Bulk editing issues and merge requests at the project level
- Code Owners
- Compliance
- License Compliance
- Compliance Dashboard
- Create a project
- Description templates
- Deploy Keys
- Deploy Tokens
- File finder
- Project integrations
- Integrations
- Atlassian Bamboo CI Service
- Bugzilla Service
- Custom Issue Tracker service
- Discord Notifications service
- Enabling emails on push
- GitHub project integration
- Hangouts Chat service
- Atlassian HipChat
- Irker IRC Gateway
- GitLab Jira integration
- Mattermost Notifications Service
- Mattermost slash commands
- Microsoft Teams service
- Mock CI Service
- Prometheus integration
- Redmine Service
- Slack Notifications Service
- Slack slash commands
- GitLab Slack application
- Webhooks
- YouTrack Service
- Insights
- Issues
- Crosslinking Issues
- Design Management
- Confidential issues
- Due dates
- Issue Boards
- Issue Data and Actions
- Labels
- Managing issues
- Milestones
- Multiple Assignees for Issues
- Related issues
- Service Desk
- Sorting and ordering issue lists
- Issue weight
- Associate a Zoom meeting with an issue
- Merge requests
- Allow collaboration on merge requests across forks
- Merge Request Approvals
- Browser Performance Testing
- How to create a merge request
- Cherry-pick changes
- Code Quality
- Load Performance Testing
- Merge Request dependencies
- Fast-forward merge requests
- Merge when pipeline succeeds
- Merge request conflict resolution
- Reverting changes
- Reviewing and managing merge requests
- Squash and merge
- Merge requests versions
- Draft merge requests
- Members of a project
- Migrating projects to a GitLab instance
- Import your project from Bitbucket Cloud to GitLab
- Import your project from Bitbucket Server to GitLab
- Migrating from ClearCase
- Migrating from CVS
- Import your project from FogBugz to GitLab
- Gemnasium
- Import your project from GitHub to GitLab
- Project importing from GitLab.com to your private GitLab instance
- Import your project from Gitea to GitLab
- Import your Jira project issues to GitLab
- Migrating from Perforce Helix
- Import Phabricator tasks into a GitLab project
- Import multiple repositories by uploading a manifest file
- Import project from repo by URL
- Migrating from SVN to GitLab
- Migrating from TFVC to Git
- Push Options
- Releases
- Repository
- Branches
- Git Attributes
- File Locking
- Git file blame
- Git file history
- Repository mirroring
- Protected branches
- Protected tags
- Push Rules
- Reduce repository size
- Signing commits with GPG
- Syntax Highlighting
- GitLab Web Editor
- Web IDE
- Requirements Management
- Project settings
- Project import/export
- Project access tokens (Alpha)
- Share Projects with other Groups
- Snippets
- Static Site Editor
- Wiki
- Project operations
- Monitor metrics for your CI/CD environment
- Set up alerts for Prometheus metrics
- Embedding metric charts within GitLab-flavored Markdown
- Embedding Grafana charts
- Using the Metrics Dashboard
- Dashboard YAML properties
- Metrics dashboard settings
- Panel types for dashboards
- Using Variables
- Templating variables for metrics dashboards
- Prometheus Metrics library
- Monitoring AWS Resources
- Monitoring HAProxy
- Monitoring Kubernetes
- Monitoring NGINX
- Monitoring NGINX Ingress Controller
- Monitoring NGINX Ingress Controller with VTS metrics
- Alert Management
- Error Tracking
- Tracing
- Incident Management
- GitLab Status Page
- Feature Flags
- GitLab CI/CD
- GitLab CI/CD pipeline configuration reference
- GitLab CI/CD include examples
- Introduction to CI/CD with GitLab
- Getting started with GitLab CI/CD
- How to enable or disable GitLab CI/CD
- Using SSH keys with GitLab CI/CD
- Migrating from CircleCI
- Migrating from Jenkins
- Auto DevOps
- Getting started with Auto DevOps
- Requirements for Auto DevOps
- Customizing Auto DevOps
- Stages of Auto DevOps
- Upgrading PostgreSQL for Auto DevOps
- Cache dependencies in GitLab CI/CD
- GitLab ChatOps
- Cloud deployment
- Docker integration
- Building Docker images with GitLab CI/CD
- Using Docker images
- Building images with kaniko and GitLab CI/CD
- GitLab CI/CD environment variables
- Predefined environment variables reference
- Where variables can be used
- Deprecated GitLab CI/CD variables
- Environments and deployments
- Protected Environments
- GitLab CI/CD Examples
- Test a Clojure application with GitLab CI/CD
- Using Dpl as deployment tool
- Testing a Phoenix application with GitLab CI/CD
- End-to-end testing with GitLab CI/CD and WebdriverIO
- DevOps and Game Dev with GitLab CI/CD
- Deploy a Spring Boot application to Cloud Foundry with GitLab CI/CD
- How to deploy Maven projects to Artifactory with GitLab CI/CD
- Testing PHP projects
- Running Composer and NPM scripts with deployment via SCP in GitLab CI/CD
- Test and deploy Laravel applications with GitLab CI/CD and Envoy
- Test and deploy a Python application with GitLab CI/CD
- Test and deploy a Ruby application with GitLab CI/CD
- Test and deploy a Scala application to Heroku
- GitLab CI/CD for external repositories
- Using GitLab CI/CD with a Bitbucket Cloud repository
- Using GitLab CI/CD with a GitHub repository
- GitLab Pages
- GitLab Pages
- GitLab Pages domain names, URLs, and baseurls
- Create a GitLab Pages website from scratch
- Custom domains and SSL/TLS Certificates
- GitLab Pages integration with Let's Encrypt
- GitLab Pages Access Control
- Exploring GitLab Pages
- Incremental Rollouts with GitLab CI/CD
- Interactive Web Terminals
- Optimizing GitLab for large repositories
- Metrics Reports
- CI/CD pipelines
- Pipeline Architecture
- Directed Acyclic Graph
- Multi-project pipelines
- Parent-child pipelines
- Pipelines for Merge Requests
- Pipelines for Merged Results
- Merge Trains
- Job artifacts
- Pipeline schedules
- Pipeline settings
- Triggering pipelines through the API
- Review Apps
- Configuring GitLab Runners
- GitLab CI services examples
- Using MySQL
- Using PostgreSQL
- Using Redis
- Troubleshooting CI/CD
- GitLab Package Registry
- GitLab Container Registry
- Dependency Proxy
- GitLab Composer Repository
- GitLab Conan Repository
- GitLab Maven Repository
- GitLab NPM Registry
- GitLab NuGet Repository
- GitLab PyPi Repository
- API Docs
- API resources
- .gitignore API
- GitLab CI YMLs API
- Group and project access requests API
- Appearance API
- Applications API
- Audit Events API
- Avatar API
- Award Emoji API
- Project badges API
- Group badges API
- Branches API
- Broadcast Messages API
- Project clusters API
- Group clusters API
- Instance clusters API
- Commits API
- Container Registry API
- Custom Attributes API
- Dashboard annotations API
- Dependencies API
- Deploy Keys API
- Deployments API
- Discussions API
- Dockerfiles API
- Environments API
- Epics API
- Events
- Feature Flags API
- Feature flag user lists API
- Freeze Periods API
- Geo Nodes API
- Group Activity Analytics API
- Groups API
- Import API
- Issue Boards API
- Group Issue Boards API
- Issues API
- Epic Issues API
- Issues Statistics API
- Jobs API
- Keys API
- Labels API
- Group Labels API
- License
- Licenses API
- Issue links API
- Epic Links API
- Managed Licenses API
- Markdown API
- Group and project members API
- Merge request approvals API
- Merge requests API
- Project milestones API
- Group milestones API
- Namespaces API
- Notes API
- Notification settings API
- Packages API
- Pages domains API
- Pipeline schedules API
- Pipeline triggers API
- Pipelines API
- Project Aliases API
- Project import/export API
- Project repository storage moves API
- Project statistics API
- Project templates API
- Projects API
- Protected branches API
- Protected tags API
- Releases API
- Release links API
- Repositories API
- Repository files API
- Repository submodules API
- Resource label events API
- Resource milestone events API
- Resource weight events API
- Runners API
- SCIM API
- Search API
- Services API
- Application settings API
- Sidekiq Metrics API
- Snippets API
- Project snippets
- Application statistics API
- Suggest Changes API
- System hooks API
- Tags API
- Todos API
- Users API
- Project-level Variables API
- Group-level Variables API
- Version API
- Vulnerabilities API
- Vulnerability Findings API
- Wikis API
- GraphQL API
- Getting started with GitLab GraphQL API
- GraphQL API Resources
- API V3 to API V4
- Validate the .gitlab-ci.yml (API)
- User Docs
- Abuse reports
- User account
- Active sessions
- Deleting a User account
- Permissions
- Personal access tokens
- Profile preferences
- Threads
- GitLab and SSH keys
- GitLab integrations
- Git
- GitLab.com settings
- Infrastructure as code with Terraform and GitLab
- GitLab keyboard shortcuts
- GitLab Markdown
- AsciiDoc
- GitLab Notification Emails
- GitLab Quick Actions
- Autocomplete characters
- Reserved project and group names
- Search through GitLab
- Advanced Global Search
- Advanced Syntax Search
- Time Tracking
- GitLab To-Do List
- Administrator Docs
- Reference architectures
- Reference architecture: up to 1,000 users
- Reference architecture: up to 2,000 users
- Reference architecture: up to 3,000 users
- Reference architecture: up to 5,000 users
- Reference architecture: up to 10,000 users
- Reference architecture: up to 25,000 users
- Reference architecture: up to 50,000 users
- Troubleshooting a reference architecture set up
- Working with the bundled Consul service
- Configuring PostgreSQL for scaling
- Configuring GitLab application (Rails)
- Load Balancer for multi-node GitLab
- Configuring a Monitoring node for Scaling and High Availability
- NFS
- Working with the bundled PgBouncer service
- Configuring Redis for scaling
- Configuring Sidekiq
- Admin Area settings
- Continuous Integration and Deployment Admin settings
- Custom instance-level project templates
- Diff limits administration
- Enable and disable GitLab features deployed behind feature flags
- Geo nodes Admin Area
- GitLab Pages administration
- Health Check
- Job logs
- Labels administration
- Log system
- PlantUML & GitLab
- Repository checks
- Repository storage paths
- Repository storage types
- Account and limit settings
- Service templates
- System hooks
- Changing your time zone
- Uploads administration
- Abuse reports
- Activating and deactivating users
- Audit Events
- Blocking and unblocking users
- Broadcast Messages
- Elasticsearch integration
- Gitaly
- Gitaly Cluster
- Gitaly reference
- Monitoring GitLab
- Monitoring GitLab with Prometheus
- Performance Bar
- Usage statistics
- Object Storage
- Performing Operations in GitLab
- Cleaning up stale Redis sessions
- Fast lookup of authorized SSH keys in the database
- Filesystem Performance Benchmarking
- Moving repositories managed by GitLab
- Run multiple Sidekiq processes
- Sidekiq MemoryKiller
- Switching to Puma
- Understanding Unicorn and unicorn-worker-killer
- User lookup via OpenSSH's AuthorizedPrincipalsCommand
- GitLab Package Registry administration
- GitLab Container Registry administration
- Replication (Geo)
- Geo database replication
- Geo with external PostgreSQL instances
- Geo configuration
- Using a Geo Server
- Updating the Geo nodes
- Geo with Object storage
- Docker Registry for a secondary node
- Geo for multiple nodes
- Geo security review (Q&A)
- Location-aware Git remote URL with AWS Route53
- Tuning Geo
- Removing secondary Geo nodes
- Geo data types support
- Geo Frequently Asked Questions
- Geo Troubleshooting
- Geo validation tests
- Disaster Recovery (Geo)
- Disaster recovery for planned failover
- Bring a demoted primary node back online
- Automatic background verification
- Rake tasks
- Back up and restore GitLab
- Clean up
- Namespaces
- Maintenance Rake tasks
- Geo Rake Tasks
- GitHub import
- Import bare repositories
- Integrity check Rake task
- LDAP Rake tasks
- Listing repository directories
- Praefect Rake tasks
- Project import/export administration
- Repository storage Rake tasks
- Generate sample Prometheus data
- Uploads migrate Rake tasks
- Uploads sanitize Rake tasks
- User management
- Webhooks administration
- X.509 signatures
- Server hooks
- Static objects external storage
- Updating GitLab
- GitLab release and maintenance policy
- Security
- Password Storage
- Custom password length limits
- Restrict allowed SSH key technologies and minimum length
- Rate limits
- Webhooks and insecure internal web services
- Information exclusivity
- How to reset your root password
- How to unlock a locked user from the command line
- User File Uploads
- How we manage the TLS protocol CRIME vulnerability
- User email confirmation at sign-up
- Security of running jobs
- Proxying assets
- CI/CD Environment Variables
- Contributor and Development Docs
- Contribute to GitLab
- Community members & roles
- Implement design & UI elements
- Issues workflow
- Merge requests workflow
- Code Review Guidelines
- Style guides
- GitLab Architecture Overview
- CI/CD development documentation
- Database guides
- Database Review Guidelines
- Database Review Guidelines
- Migration Style Guide
- What requires downtime?
- Understanding EXPLAIN plans
- Rake tasks for developers
- Mass inserting Rails models
- GitLab Documentation guidelines
- Documentation Style Guide
- Documentation structure and template
- Documentation process
- Documentation site architecture
- Global navigation
- GitLab Docs monthly release process
- Telemetry Guide
- Usage Ping Guide
- Snowplow Guide
- Experiment Guide
- Feature flags in development of GitLab
- Feature flags process
- Developing with feature flags
- Feature flag controls
- Document features deployed behind feature flags
- Frontend Development Guidelines
- Accessibility & Readability
- Ajax
- Architecture
- Axios
- Design Patterns
- Frontend Development Process
- DropLab
- Emojis
- Filter
- Frontend FAQ
- GraphQL
- Icons and SVG Illustrations
- InputSetter
- Performance
- Principles
- Security
- Tooling
- Vuex
- Vue
- Geo (development)
- Geo self-service framework (alpha)
- Gitaly developers guide
- GitLab development style guides
- API style guide
- Go standards and style guidelines
- GraphQL API style guide
- Guidelines for shell commands in the GitLab codebase
- HTML style guide
- JavaScript style guide
- Migration Style Guide
- Newlines style guide
- Python Development Guidelines
- SCSS style guide
- Shell scripting standards and style guidelines
- Sidekiq debugging
- Sidekiq Style Guide
- SQL Query Guidelines
- Vue.js style guide
- Instrumenting Ruby code
- Testing standards and style guidelines
- Flaky tests
- Frontend testing standards and style guidelines
- GitLab tests in the Continuous Integration (CI) context
- Review Apps
- Smoke Tests
- Testing best practices
- Testing levels
- Testing Rails migrations at GitLab
- Testing Rake tasks
- End-to-end Testing
- Beginner's guide to writing end-to-end tests
- End-to-end testing Best Practices
- Dynamic Element Validation
- Flows in GitLab QA
- Page objects in GitLab QA
- Resource class in GitLab QA
- Style guide for writing end-to-end tests
- Testing with feature flags
- Translate GitLab to your language
- Internationalization for GitLab
- Translating GitLab
- Proofread Translations
- Merging translations from CrowdIn
- Value Stream Analytics development guide
- GitLab subscription
- Activate GitLab EE with a license