I spent a long time with 2 kubernetes clusters to try to build images with Drone.
I installed Drone with helm chart (official) and I’m using Gitea. Everything is fine until I try to build image.
My .drone.yml file is:
kind: pipeline name: default steps: - name: test image: plugins/docker commands: - docker ps
I also tried “docker” image and “docker:dind”. What I see is:
+ docker ps Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
My repository is “Trusted” and I set up drone with my admin account that is the user on gitea which is mine.
The problem is that, later, I want to use “source to image” to build image and push it on my private repository, so I will need that kind of commands:
- s2i build . my-base-image 10.x.x.x:5000/my-app-image - docker push 10.x.x.x:5000/my-app-image
And it needs docker to pull base image, then push my image.
Here is the lines in drone deployment:
- env: - name: DRONE_KUBERNETES_ENABLED value: "true" - name: DRONE_KUBERNETES_NAMESPACE value: drone - name: DRONE_KUBERNETES_SERVICE_ACCOUNT value: drone-drone-pipeline - name: DRONE_GIT_ALWAYS_AUTH value: "false" # I hide that - name: DRONE_SERVER_HOST value: drone.XXXXX - name: DRONE_SERVER_PROTO value: https - name: DRONE_USER_CREATE value: username:metal3d,machine:false,admin:true - name: DRONE_RPC_SECRET valueFrom: secretKeyRef: key: secret name: drone-drone - name: DRONE_DATABASE_DATASOURCE value: /var/lib/drone/drone.sqlite - name: DRONE_DATABASE_DRIVER value: sqlite3 - name: DRONE_LOGS_DEBUG value: "false" # I hide that - name: DRONE_GITEA_SERVER value: https://XXXXXX
Also, note that I didn’t found any /var/lib/docker mount point in the deployment, so I really wonder how Drone can build image in Kubernetes “pods”.