LauritsT
LauritsT

Reputation: 67

Specifying docker options for GitLab CI/CD

I need to add the following options to run the Docker image. However I gave been unable to find from the documentation how one specifies these options in .gitlab-ci.yml

–device /dev/fuse --cap-add SYS_ADMIN --cap-add=MKNOD --security-opt apparmor:unconfined

Upvotes: 3

Views: 3355

Answers (1)

swysocki
swysocki

Reputation: 1086

Those Docker options are not configured in the .gitlab-ci.yml file, they are specified in the runner's configuration found in the config.toml file.

The [runners.docker] section allows you to configure these options on a per-runner basis.

Here is an example of how to set those options:

[[runners]]
...
  [runners.docker]
    tls_verify = false
    image = "{your-image:tag}"
    cap_add = ["SYS_ADMIN", "MKNOD"]
    devices = ["/dev/fuse"]
    security_opt = ["apparmor:unconfined"]
    ...

Upvotes: 3

Related Questions