You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: common/config.go
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ import (
23
23
"sigs.k8s.io/yaml"
24
24
25
25
"github.com/BurntSushi/toml"
26
+
"github.com/docker/docker/api/types/container"
26
27
"github.com/docker/go-units"
27
28
"github.com/minio/minio-go/v7/pkg/s3utils"
28
29
"github.com/sirupsen/logrus"
@@ -310,6 +311,7 @@ type DockerConfig struct {
310
311
EnableIPv6bool`toml:"enable_ipv6,omitempty" json:"enable_ipv6" long:"enable-ipv6" description:"Enable IPv6 for automatically created networks. This is only takes affect when the feature flag FF_NETWORK_PER_BUILD is enabled."`
311
312
Ulimitmap[string]string`toml:"ulimit,omitempty" json:"ulimit,omitempty" long:"ulimit" env:"DOCKER_ULIMIT" description:"Ulimit options for container"`
312
313
NetworkMTUint`toml:"network_mtu,omitempty" json:"network_mtu" long:"network-mtu" description:"MTU of the Docker network created for the job IFF the FF_NETWORK_PER_BUILD feature-flag was specified."`
314
+
LogOptionsmap[string]string`toml:"log_options,omitempty" json:"log_options,omitempty" long:"log-options" env:"DOCKER_LOG_OPTIONS" description:"Log driver options for json-file logging"`
313
315
}
314
316
315
317
typeInstanceConfigstruct {
@@ -1684,6 +1686,36 @@ func (c *DockerConfig) GetServicesLimit() int {
1684
1686
return*c.ServicesLimit
1685
1687
}
1686
1688
1689
+
// GetLogConfig returns the LogConfig for build containers
Copy file name to clipboardExpand all lines: docs/configuration/advanced-configuration.md
+46Lines changed: 46 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -559,6 +559,7 @@ The following settings define the Docker container parameters. These settings ar
559
559
| `hostname` | | Custom hostname for the Docker container. |
560
560
| `image` | `"ruby:3.3"` | The image to run jobs with. |
561
561
| `links` | `["mysql_container:mysql"]` | Containers that should be linked with container that runs the job. |
562
+
| `log_options` | `{"env": "GITLAB_CI_JOB_ID,GITLAB_CI_JOB_NAME", "labels": "com.gitlab.gitlab-runner.type"}` | Log driver options for Docker containers that use the `json-file` log driver. Only `env` and `labels` options are allowed. For more information, see [Docker log options](#docker-log-options). |
562
563
| `memory` | `"128m"` | The memory limit. A string. |
563
564
| `memory_swap` | `"256m"` | The total memory limit. A string. |
564
565
| `memory_reservation` | `"64m"` | The memory soft limit. A string. |
GitLab Runner validates log options during executor preparation. If you specify unsupported options
754
+
such as `max-size`, `max-file`, or `compress`, the job fails immediately with a configuration error.
755
+
756
+
The log options apply to the main job container and any service containers defined in your CI/CD configuration.
757
+
758
+
For more information about Docker logging, see the [Docker `json-file` log driver documentation](https://docs.docker.com/config/containers/logging/json-file/).
759
+
714
760
### Use a private container registry
715
761
716
762
To use private registries as a source of images for your jobs, configure authorization
0 commit comments