Clone failed when i use custom git image

Hi, all.

I’m beginner about Drone. And i have a problem when i use drone 1.0, i want to clone repository use my private git image, because my host can’t connect external dockerhub. But i set custom git image in pipeline, the pipeline failed and log always show clone:Failure, and the detail error log is Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) .

Is it my pipeline wrong?

---
kind: pipeline
name: development

clone:
  git:
    image: docker.cloud/drone/git:1.5.0
    tags: true
    skip_verify: true
    remote: "https://sys-gitlab.cloud.com/pytimer/node-pool-operator.git"

workspace:
  base: /go
  path: src/cloud.com/pytimer/node-pool-operator

steps:
- name: test
  image: docker.cloud/kubernetes/kubebuilder:1.0.8
  environment:
    GOOS: linux
    GOARCH: amd64
  commands:
    - make test
  when:
    event:
    - push
    - tag
    - pull_request

The clone syntax in the above example is incorrect. See https://docs.drone.io/user-guide/pipeline/cloning/#custom-logic

Thanks for you reply @bradrydzewski.

I follow your link to change the custom clone logic, it work. Thanks.

But i have a another problem, like below:

kind: pipeline
name: development

clone:
  disable: true

workspace:
  base: /go
  path: src/cloud.com/pytimer/node-pool-operator

steps:
- name: clone
  image: docker.cloud/drone/git:1.5.0
  environment:
    PLUGIN_SKIP_VERIFY: true
    PLUGIN_TAGS: true
    DRONE_REMOTE_URL: "https://sys-gitlab.cloud.com/pytimer/node-pool-operator.git"

- name: build
  image: docker.cloud/plugins/docker
  settings:
    repo: docker.cloud/kubernetes/node-pool-operator
    auto_tag: true
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    insecure: true
    privileged: true
    registry: docker.cloud
    dockerfile: Dockerfile
  when:
    event:
    - tag

The drone will return Error authenticating: exit status 1, i think it maybe the docker_username or docker_password wrong, but in drone 0.8, i also use the same secret, it ok. So i want to how to check this problem? Thanks.

you must to use plugins/docker as the image. This image is whitelisted and will run in privileged mode. If you do not use the correct name, it will not match the whitelist and will not work as expected.

- image: docker.cloud/plugins/docker
+ image: plugins/docker

But in my development environment, i can’t connect external network. Can i use custom image instead of it?

docker.cloud/plugins/docker is plugins/docker rename and push to my private registry.

@bradrydzewski I find my .drone.yml error, i use custom image, so i must setting privileged: true, but i setting this parameter in settings, so authentication failed. I update my .drone.yml like below, it’s works ok.

  image: docker.cloud/plugins/docker
+ privileged: true
  settings:
    repo: docker.cloud/kubernetes/node-pool-operator
    auto_tag: true
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    insecure: true
-   privileged: true
    registry: docker.cloud
    dockerfile: Dockerfile
  when:
    event:
    - tag