DroneCI服务器0.8无法打开数据库文件

时间:2018-03-12 16:40:57

标签: sqlite docker-compose drone drone.io

我正努力让DroneCI启动并运行,使用下面的(已消毒的)docker-compose.yaml

(请参阅底部的链接,了解docker-compose up执行的输出)。

# Docker compose file syntax:
version: '2'

services:
  drone-server:
    image: drone/drone:0.8

    ports:
      - 5124:8000
      - 5125:9000
    volumes:
      - '/var/lib/drone:/var/lib/drone/:Z'
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=http://drone.COMPANY.intra:80
      - DRONE_STASH=true
      - DRONE_STASH_GIT_USERNAME=USERNAME
      - DRONE_STASH_GIT_PASSWORD=PASSWORD
      - DRONE_STASH_CONSUMER_KEY=CONSUMER_KEY
      - DRONE_STASH_CONSUMER_RSA=/etc/bitbucket/key.pem
      - DRONE_STASH_URL=https://COMPANY_URL.intra
      - DRONE_SECRET=SECRET1
    volumes:
      - '/etc/bitbucket/key.pem:/etc/bitbucket/key.pem:Z'

  drone-agent:
    image: drone/agent:0.8

    restart: always
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:Z
    environment:
      - DRONE_SERVER=http://drone.COMPANY.intra
      - DRONE_SECRET=SECRET1

我缺少/没看到的是什么?

我找到this,这看起来非常熟悉......

但是,如果这是根本原因,我如何设置我目前假设居住在drone/drone:0.8图像中的数据库文件的权限? (看起来很奇怪它虽然是创造它的容器......)

官方文档中也没有提及数据库文件,herehere = /。

链接:

  1. 原创讨论@ discourse.drone.io

    • (建议在这里试试我的运气@S / O)。
  2. 链接到承诺的要点与正常(和详细) - 消毒! - 输出:

1 个答案:

答案 0 :(得分:3)

您的docker-compose文件至少有两个问题:

1)您在无人机服务器的配置中有两次volumes:部分,合并并将两个卷映射放在同一部分中

2)在无人机代理配置中,无人机服务器的URL错误,它不应包含http://方案,并且它缺少端口,请尝试DRONE_SERVER=drone-server:9000

docker-compose.yml

# Docker compose file syntax:
version: '2'

services:
  drone-server:
    image: drone/drone:0.8

    ports:
      - 5124:8000
      - 5125:9000
    volumes:
      - '/var/lib/drone:/var/lib/drone/:Z'
      - '/etc/bitbucket/key.pem:/etc/bitbucket/key.pem:Z'
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=http://drone.COMPANY.intra:80
      - DRONE_STASH=true
      - DRONE_STASH_GIT_USERNAME=USERNAME
      - DRONE_STASH_GIT_PASSWORD=PASSWORD
      - DRONE_STASH_CONSUMER_KEY=CONSUMER_KEY
      - DRONE_STASH_CONSUMER_RSA=/etc/bitbucket/key.pem
      - DRONE_STASH_URL=https://COMPANY_URL.intra
      - DRONE_SECRET=SECRET1

  drone-agent:
    image: drone/agent:0.8

    restart: always
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:Z
    environment:
      - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET=SECRET1