# 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