Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker task failing #1173

Open
rushikeshkulat95 opened this issue Jun 23, 2023 · 2 comments
Open

docker task failing #1173

rushikeshkulat95 opened this issue Jun 23, 2023 · 2 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@rushikeshkulat95
Copy link

rushikeshkulat95 commented Jun 23, 2023

Expected Behavior

docker build successful

Actual Behavior

Could not read CA certificate "/certs/client/ca.pem": open /certs/client/ca.pem: no such file or directory

Steps to Reproduce the Problem

Additional Info

my tekton is running on Azure Kubernetes cluster . I'm tying to execute docker command in task but its failing with below error
ERROR: Cannot connect to the Docker daemon at tcp://localhost:2376. Is the docker daemon running?
task :
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: docker-build
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/categories: Image Build
tekton.dev/tags: docker, build-image, push-image, dind
tekton.dev/displayName: docker-build
tekton.dev/platforms: "linux/amd64"
spec:
description: >-
This task will build and push an image using docker.
The task will build an out image out of a Dockerfile.
This image will be pushed to an image registry.
The image will be built and pushed using a dind sidecar over TCP+TLS.
params:

  • name: image
    description: Reference of the image docker will produce.

  • name: builder_image
    description: The location of the docker builder image.
    default: docker:stable

  • name: dind_image
    description: The location of the docker-in-docker image.
    default: docker:dind

  • name: dockerfile
    description: Path to the Dockerfile to build.
    default: ./source/Dockerfile

  • name: context
    description: Path to the directory to use as context.
    default: .

  • name: build_extra_args
    description: Extra parameters passed for the build command when building images.
    default: ""

  • name: push_extra_args
    description: Extra parameters passed for the push command when pushing images.
    default: ""

  • name: insecure_registry
    description: Allows the user to push to an insecure registry that has been specified
    default: ""
    workspaces:

  • name: source
    volumes:

  • name: dind-certs
    emptyDir: {}
    results:

  • name: IMAGE_DIGEST
    description: Digest of the image just built.
    sidecars:

  • image: $(params.dind_image)
    name: server
    args:

    • --storage-driver=vfs

    • --userland-proxy=false

    • --debug

    • --insecure-registry=$(params.insecure_registry)
      securityContext:
      privileged: true
      env:

    • name: DOCKER_TLS_CERTDIR
      value: /certs
      volumeMounts:

    • mountPath: /certs/client
      name: dind-certs

    readinessProbe:
    periodSeconds: 1
    exec:
    command: ['ls', '/certs/client/ca.pem']
    steps:

  • name: docker-build
    image: $(params.builder_image)
    env:

    • name: DOCKER_HOST
      value: tcp://localhost:2376

    • name: DOCKER_TLS_VERIFY
      value: '1'

    • name: DOCKER_CERT_PATH
      value: /certs/client
      workingDir: $(workspaces.source.path)
      script: |
      docker build
      $(params.build_extra_args)
      --no-cache
      -f $(params.dockerfile) -t $(params.image) $(params.context)
      volumeMounts:

      • mountPath: /certs/client
        name: dind-certs

taskrun :

apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
generateName: docker-
spec:
params:

  • name: image
    value: localhost:5000/nocode
    taskRef:
    name: docker-build
    workspaces:
  • name: source
    persistentVolumeClaim:
    claimName: tekton-pvc

when i changed images im getting below error
Could not read CA certificate "/certs/client/ca.pem": open /certs/client/ca.pem: no such file or directory

  • name: builder_image
    description: The location of the docker builder image.
    default: docker:1.12.6
    • name: dind_image
      description: The location of the docker-in-docker image.
      default: docker:1.12.6-dind
@tekton-robot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 21, 2023
@tekton-robot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

2 participants