# I encountered an issue while deploying Drone using pipeline in k8s

**URL:** https://drone.discourse.group/t/i-encountered-an-issue-while-deploying-drone-using-pipeline-in-k8s/13423
**Category:** Drone Support
**Created:** [February 17, 2023, 12:01pm UTC](https://drone.discourse.group/t/i-encountered-an-issue-while-deploying-drone-using-pipeline-in-k8s/13423 "2023-02-17T12:01:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Bluebang](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bluebang/32/8647_2.png) [@Bluebang](https://drone.discourse.group/u/Bluebang)
#### Post date: [February 17, 2023, 12:01pm UTC](https://drone.discourse.group/t/i-encountered-an-issue-while-deploying-drone-using-pipeline-in-k8s/13423/1 "2023-02-17T12:01:07Z")

</div>

Hello all，My example is compiling a Vue project and building it into a Docker image, then publishing it to a remote image repository. When I used the plugins/docker plugin, it prompted the following error:

```auto
+ /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock
Unable to reach Docker Daemon after 15 attempts.
Registry credentials or Docker config not provided. Guest mode enabled.
+ /usr/local/bin/docker version
Client:
 Version: 20.10.14
 API version: 1.41
 Go version: go1.16.15
 Git commit: a224086
 Built: Thu Mar 24 01:45:09 2022
 OS/Arch: linux/amd64
 Context: default
 Experimental: true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
exit status 1

```

Here is my YAML code:

```auto
kind: pipeline
type: kubernetes
name: default
steps:
  - name: build
    image: node:14
    volumes:
      - name: build
        path: /app/build
    commands:
      - npm config set registry http://registry.npm.taobao.org
      - export CHROMEDRIVER_CDNURL=https://npm.taobao.org/mirrors/chromedriver
      - npm install
      - npm run build
    when:
      event:
        - push
      branch:
        - master
  - name: upload-to-acr
    image: plugins/docker
    volumes:
      - name: build
        path: /app/build
    settings:
      username:
        from_secret: XXXX
      password:
        from_secret: XXXX
      repo: registry.cn-hangzhou.aliyuncs.com/lsl-testresp/drone_test_resp
      tags: v${DRONE_BUILD_NUMBER}
      purge: true
    when:
      event:
        - push
        - tag
volumes: 
  - name: build
    host:
      path: /home/docker/drone/build 
trigger:
  event:
    - push
    - pull_request
    - rollback
    - custom

```

please tell me what the problem is? Or can you provide an example of packaging a Vue project into a Docker image?

---

<div class="post-metadata">

### Author: ![kryptonian](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kryptonian/32/8645_2.png) [@kryptonian](https://drone.discourse.group/u/kryptonian)
#### Post date: [February 18, 2023, 4:07am UTC](https://drone.discourse.group/t/i-encountered-an-issue-while-deploying-drone-using-pipeline-in-k8s/13423/2 "2023-02-18T04:07:04Z")

</div>

One issue probably is that you’re using the deprecated Kubernetes runner but I’m in the same boat. dind will not wanna work at all.

---

<div class="post-metadata">

### Author: ![Bluebang](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bluebang/32/8647_2.png) [@Bluebang](https://drone.discourse.group/u/Bluebang)
#### Post date: [February 18, 2023, 1:04pm UTC](https://drone.discourse.group/t/i-encountered-an-issue-while-deploying-drone-using-pipeline-in-k8s/13423/3 "2023-02-18T13:04:14Z")

</div>

Is there the latest runner that can be used in k8s? I just know that there is no official runtime in k8s 😵‍💫

---

<div class="post-metadata">

### Author: ![Bluebang](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bluebang/32/8647_2.png) [@Bluebang](https://drone.discourse.group/u/Bluebang)
#### Post date: [February 18, 2023, 2:59pm UTC](https://drone.discourse.group/t/i-encountered-an-issue-while-deploying-drone-using-pipeline-in-k8s/13423/4 "2023-02-18T14:59:50Z")

</div>

Can you help me to have a look? tks

> [@Docker:dind not work in k8s](https://drone.discourse.group/t/docker-dind-not-work-in-k8s/13428):
>
> error： Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? my pipeline: --- kind: pipeline type: kubernetes name: default steps: - name: test image: docker:dind volumes: - name: dockersock path: /var/run commands: - sleep 5 # give docker enough time to start - docker ps -a services: - name: docker image: docker:dind privileged: true volumes: - name: dockersock path: /var/run volumes: - name: dockersock host: pa…

---

<div class="post-metadata">

### Author: ![kryptonian](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kryptonian/32/8645_2.png) [@kryptonian](https://drone.discourse.group/u/kryptonian)
#### Post date: [February 18, 2023, 11:29pm UTC](https://drone.discourse.group/t/i-encountered-an-issue-while-deploying-drone-using-pipeline-in-k8s/13423/5 "2023-02-18T23:29:39Z")

</div>

It’s worth noting that the Drone Kubernetes runner is now deprecated. Instead, you should use the Docker runner for executing Docker-based pipelines in Kubernetes. A Helm chart for the Docker runner is available here: [charts/charts/drone-runner-docker at master · drone/charts · GitHub](https://github.com/drone/charts/blob/master/charts/drone-runner-docker).

To help you get started, I’ve included a sample YAML for building using the Docker runner:

```yaml
kind: pipeline
name: build-container-amd64

platform:
  os: linux
  arch: amd64

# Define the steps of the pipeline
steps:
  - name: build-amd64
    image: plugins/docker
    settings:
      username:
        from_secret: REGISTRY_USER
      password:
        from_secret: REGISTRY_PASSWORD
      registry: git.<snip>.fi
      repo: git.<snip>.fi/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}
      tags:
        - latest-amd64

```

If you found this information helpful, please consider making a donation to support my continued work. Your donation will help cover the costs of researching and creating new resources, and will allow me to devote more time and resources to providing useful content. A donation of €5-€10 would be greatly appreciated, but any amount helps. Thank you for your support! Donate at: [BuyMeCoffee](https://www.buymeacoffee.com/skykrypt)
