加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

码头 – Gitlab跑步者自动缩放比例赛跑者选项

发布时间:2020-12-16 03:32:33 所属栏目:安全 来源:网络整理
导读:我正在使用gitlab赛跑者与码头机器执行器在AWS上启动自动缩放赛跑者.我想在跑步者中使用docker-in-docker设置来构建容器,但是我无法找到如何为生成的跑步者定义需要的[runners.docker]属性以启用docker使用. 有可能以某种方式将一些配置信息传递给自动缩放跑

我正在使用gitlab赛跑者与码头机器执行器在AWS上启动自动缩放赛跑者.我想在跑步者中使用docker-in-docker设置来构建容器,但是我无法找到如何为生成的跑步者定义需要的[runners.docker]属性以启用docker使用.

有可能以某种方式将一些配置信息传递给自动缩放跑步者?

最佳答案
你只需要在你的自动调整运行器的config.toml中:

[runners.docker]
  privileged = true

我使用docker-in-docker构建我自己的php容器进行测试,并将它们存储在gitlabs注册表中.有关构建示例,请参见https://gitlab.cwd.at/docker/php/builds/21582,构建定义的https://gitlab.cwd.at/docker/php/blob/master/.gitlab-ci.yml

看到这里我现在的配置 – 它使用S3缓存和数字海洋赛跑者:

concurrent = 10

[[runners]]
  name = "ec2-autoscale-runner"
  url = "https://gitlab.mydomain.at/ci"
  token = "12345"
  executor = "docker+machine"
  limit = 10
  environment = ["COMPOSER_CACHE_DIR=/cache"]
  [runners.machine]
    OffPeakPeriods = [               # Set the Off Peak time mode on for:
      "* * 0-9,18-23 * * mon-fri *",# - Monday to Friday for 12am to 9am and 6pm to 11pm
      "* * * * * sat,sun *"          # - whole Saturday and Sunday
    ]
    OffPeakIdleCount = 0             # There must be 1 machine in Idle state - when Off Peak time mode is on
    OffPeakIdleTime = 3550           # Each machine can be in Idle state up to 1200 seconds (after this it will be removed) - when Off Peak time mode is on
    IdleCount = 0                    # There must be 5 machines in Idle state - when Off Peak time mode is off
    IdleTime = 3550                  # Each machine can be in Idle state up to 600 seconds (after this it will be removed) - when Off Peak time mode is off
    MaxBuilds = 100                    # Each machine can handle up to 100 builds in a row (after this it will be removed)
    MachineName = "auto-scale-%s"    # Each machine will have a unique name ('%s' is required)
    MachineDriver = "digitalocean"   # Docker Machine is using the 'digitalocean' driver
    MachineOptions = [
        "digitalocean-image=21937863",#"digitalocean-image=20969606","digitalocean-access-token=12345","digitalocean-region=fra1","digitalocean-size=4gb","digitalocean-private-networking","digitalocean-ipv6=true"
    ]
  [runners.ssh]
    user = "root"
    identity_file = "/etc/gitlab-runner/id_rsa"
  [runners.docker]
    privileged = true
  [runners.cache]
    Type = "s3"
    ServerAddress = "s3.amazonaws.com"
    AccessKey = "1234"
    SecretKey = "1234"
    BucketName = "cwd-gitlab-cache"
    BucketLocation = "eu-central-1"
    Insecure = false

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读