kaniko: chown: Value too large for defined data type

Kaniko build fails (randomly) with Value too large for defined data type

Dockerfile snippet:

FROM <repo>ubuntu:latest
WORKDIR /opt/docker
ADD opt /opt
RUN ["chown", "-R", "test_nobody:test_nobody", "."]

Build error :

INFO[0021] Taking snapshot of files...                  
INFO[0023] RUN ["chown", "-R", "test_nobody:test_nobody", "."] 
INFO[0023] cmd: chown                                   
INFO[0023] args: [-R test_nobody:test_nobody .]         
  chown: .: Value too large for defined data type
  error building image: error building stage: waiting for process to exit: exit status 1

Kaniko : gcr.io/kaniko-project/executor:debug Build Env: Jenkins - Kubernetes

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 21
  • Comments: 23 (10 by maintainers)

Most upvoted comments

Currently using kaniko is a bit unfortunately, because it still failes most builds (for us) on k8s clusters.

The reason as above written is a broken busybox/uclibc coming from distroless (which is i686 and breaks on hitting 64bit inodes)

The fix for us was to just add an additional layer over gcr.io/kaniko-project/executor:debug like

FROM gcr.io/kaniko-project/executor:debug
MAINTAINER Michael Gebetsroither <mgebetsroither@mgit.at>

COPY --from=amd64/busybox:1.31.0 /bin/busybox /busybox/busybox

Would be nice if this problem could finally be fixed after so many months.

Meanwhile I’ve build an Alpine Linux image with kaniko that works quite well.

Maybe this might help you, too.

https://gitlab.com/griffinplus/gitlab-kaniko

EDIT: If you use /kaniko/executor instead of the kaniko-build wrapper, the image behaves just the same as the original image.

Ran into this issue trying to build images with kaniko in a GitLab managed EKS Kubernetes cluster.

https://gitlab.com/griffinplus/gitlab-kaniko did not work, since it does not seem to have the amazon-ecr-credential-helper embedded and I do need to push to AWS ECR.

The quick and easy workaround from @gebi did the trick. Thanks @gebi!

I’ve implemented it here https://github.com/lmakarov/kaniko and using lmakarov/kaniko as the build image in GitLab for the time being.

build:
  stage: build
  image:
    #name: gcr.io/kaniko-project/executor:debug
    name: lmakarov/kaniko # See https://github.com/lmakarov/kaniko
    entrypoint: [""]
  tags:
    - kubernetes
  variables:
    IMAGE_URI: <aws-account-id>.dkr.ecr.us-east-1.amazonaws.com/<ecr-repo>:${CI_COMMIT_SHORT_SHA}
  before_script:
    - echo '{"credsStore":"ecr-login"}' > /kaniko/.docker/config.json # Enable amazon-ecr-credential-helper
  script:
    # Build and push image using Kaniko in K8s
    - /kaniko/executor --context ${CI_PROJECT_DIR} --dockerfile ${CI_PROJECT_DIR}/Dockerfile --destination ${IMAGE_URI}

Does anyone have a somewhat similar issue in GKE cluster where the build goes through but the image build misses chown-ing a folder ? Im referring to #1079

i have the same issue 😦 kaniko 0.12.0, gke 1.14.3

have to build my own kaniko build…

UPDATE: custom kaniko image doesn’t resolve the issue. I have to use bare metal k8s cluster, kaniko doesn’t work in GKE 😦((