Dan Tanner
Dan Tanner

Reputation: 2444

Drone - share docker-compose configuration?

Trying to reduce services configuration duplication between my docker-compose.yml and .drone.yml files.

Drone issue https://github.com/drone/drone/issues/906 discusses a potential config feature like this:

compose:
    from-file: docker-compose.yml

The above issue is closed, concluding that because drone is a superset of docker-compose, you should be able to use the .drone.yml file with docker-compose. But at least with docker-compose version 2.1, you can't directly use a .drone.yml file as docker-compose input because docker-compose doesn't allow unknown syntax like the drone pipeline section.

Invalid top-level property "pipeline". Valid top-level sections for this Compose file are: version, services, networks, volumes, and extensions starting with "x-".

What also complicates this slightly are drone usage constraints like absolute volumes, and network sharing differences.

Question Summary: Is there a standardized/clean way to share service config between docker-compose and drone?

Upvotes: 3

Views: 607

Answers (1)

hassanzadeh.sd
hassanzadeh.sd

Reputation: 3481

you can't docker compose up in docker dind you can use :

- name: run
  image: docker/compose:1.25.0-rc2-alpine
  commands:
    - docker-compose -f docker-compose.prod.yml up -d
  volumes:
    - name: dockersock
      path: /var/run/docker.sock
  depends_on:
    - build

Upvotes: 1

Related Questions