Docker options in pipeline

Hi everyone.
Can I set some options for docker containers?
for example I’m going to run a golang image with some network or other docker options.

something like this:

pipeline:
  build:
    image: golang:1.11
    pull: true
    docker:
      network: some_network
      dns: 8.8.8.8

you can set custom_dns: 8.8.8.8 but you cannot set network. The docker plugin runs docker-in-docker and is therefore unable to attach to any other networks.

that’s great. is there any list of these custom args? or maybe part of drone source that I can check out?

I’m having this error after I add custom_dns:

pipeline:
  deps:
    image: golang:1.11
    dns: 8.8.8.8
    commands:
      - go get -v github.com/Masterminds/glide
      - glide install

adding custom_dns, gives following error:
Cannot configure both commands and custom attributes [custom_dns]

I took a look at DNS option in Container struct and changed the custom_dns to dns, gives another error:
Insufficient privileges to use custom dns

then I add another privileged: true to drone.yml and gives this:
Insufficient privileges to use privileged mode

this is my final drone file:

pipeline:
  deps:
    image: golang:1.11
    dns: 8.8.8.8
    privileged: true
    commands:
      - go get -v github.com/Masterminds/glide
      - glide install

this is all happening in linter lintTrusted func and seems the linter is not trusted.

sorry I think I misunderstood your original question.

custom_dns is an option for the docker plugin only:
http://plugins.drone.io/drone-plugins/drone-docker/

you can use dns with any step in the pipeline, but you have to mark your repository as “trusted” in the repository settings (if you do not know how to do this, please search this forum for threads that discuss this). The privileged flag is not required here.

thanks, but it does not work with provided DNS.

I’m stuck here, Do you know how can I pass drone’s docker’s internet through a proxy or VPN?

I finally get a VPS for drone builds. then used scp and ssh plugins to transfer needed files.
thanks anyway.