0

I'm struggling to get DroneCI up and running, using the below (sanitized) docker-compose.yaml.

(See link at bottom for output from docker-compose up executions).

# 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

What is it I am missing/not seeing?

I found this, which seems eerily familiar...

However, if that's the root cause, how can I set the permissions of a database file I'm currently assuming resides in the drone/drone:0.8 image? (Seems strange that it'd be the container creating it though...)

There's also no mention of a database file in the official documentation, neither here nor here =/.

Links:

  1. Original discussion @discourse.drone.io.

    • (Was advised to try my luck here @ S/O).
  2. Link to promised gist with normal (and verbose) - sanitized! - output:

x10an14
  • 189
  • 1
  • 9
  • Does `/var/lib/drone` exist and has permissions set so drone/docker can access it and create files there? – Oliver Mar 12 '18 at 17:23
  • No, it does not. That was one of the things I became uncertain of whether or not I had to ensure myself (when reading the docs). Thanks! =) Testing it out, I see that I've got some other http2client/grpc errors depending on whether or not that host-based folder (with permissions) exist. But I'll make another question for that issue if I can't find one! =) – x10an14 Mar 13 '18 at 08:08

1 Answers1

3

There are (at least) two things wrong with your docker-compose file:

1) you have the volumes: section twice in the config for the drone server, consolidate and put both volume mappings in the same section

2) in the drone agent config, the URL of the drone server is wrong, it shouldn't include the http:// scheme and it's missing the port, try 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
Oliver
  • 11,857
  • 2
  • 36
  • 42
  • Yup! I do believe the duplicate `volumes` was the issue here! (My fault for following the BitBucket installation instructions without critical thought, ref [Private Key File section](http://readme.drone.io/admin/setup-bitbuket-server/)). Maybe something for someone with edit permissions of the docs to fix? =) – x10an14 Mar 13 '18 at 08:10