It seems that the Kube runner has been deprecated, and I’m trying to figure out how to use the runner with a k3s cluster and dind, but it fails to talk to the Docker daemon. How is one supposed to use this?
Logs of the dind container: k logs -n ci drone-gitea-runner-amd64-767dfbd446-pp82cDefaulted container "din - Pastebin.com & logs of the done-runner-docker container: time="2023-02-17T01:42:37+02:00" level=error msg="cannot ping the docker daemon" - Pastebin.com
(Log pastes will expire in 1 year.)
My pipeline is quite simple:
kind: pipeline
name: build-container-amd64
type: docker
# Define the steps of the pipeline
steps:
- name: build-amd64
image: plugins/docker
platform:
os: linux
arch: amd64
environment:
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD
REGISTRY_USER:
from_secret: REGISTRY_USER
REGISTRY:
from_secret: REGISTRY
commands:
- echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin $REGISTRY
- docker info
- docker build --pull -t "$REGISTRY/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}:latest-amd64" .
- docker push "$REGISTRY/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}:latest-amd64"
However build fails at the docker info step that I added as debug.
latest: Pulling from plugins/docker
Digest: sha256:ea4e85abad2717e19427610186315f4a4628d5100ac3040e73febdb54442c497
Status: Image is up to date for plugins/docker:latest
+ echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin $REGISTRY
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
+ docker info
errors pretty printing info
Client:
Context: default
Debug Mode: false
Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
My runner helm values:
replicaCount: 1
fullnameOverride: drone-gitea-runner-amd64
dind:
## The official docker (dind) image, change tag to use a different version.
## ref: https://hub.docker.com/r/library/docker/tags/
##
registry: docker.io
repository: docker
tag: 23-dind
pullPolicy: IfNotPresent
command:
- "dockerd"
commandArgs:
- "--host"
- "tcp://0.0.0.0:2375"
securityContext:
privileged: true
## If you have declared extra volumes, mount them here, per the Pod Container's
## "volumeMounts" section of dind container
##
extraVolumeMounts:
- name: storage
mountPath: /var/lib/docker
subPath: docker
extraSecretNamesForEnvFrom:
- drone-gitea-runner-secrets
env:
DRONE_RPC_HOST: drone-gitea:8080
DRONE_RPC_PROTO: http
DRONE_SERVER_HOST: "drone-gitea.<snip>.fi"
DRONE_NAMESPACE_DEFAULT: ci
DOCKER_HOST: "tcp://localhost:2375"
nodeSelector:
kubernetes.io/arch: amd64