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

Error /kaniko/executor: No such file or directory #2380

Open
tech-discuss opened this issue Feb 1, 2023 · 2 comments
Open

Error /kaniko/executor: No such file or directory #2380

tech-discuss opened this issue Feb 1, 2023 · 2 comments
Labels
area/container For all bugs related to the kaniko container kind/question Further information is requested needs-follow-up ok-to-close? priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@tech-discuss
Copy link

### .gitlab-ci.yml file

image: google/cloud-sdk:latest
variables:
  PROJECT_ID: $GCP_PROJECT_ID
  IMAGE: gcr.io/$GCP_PROJECT_ID/vonome-official-website:latest2

before_script:
  - apt-get update && apt-get install -y wget
  - |
      wget https://github.com/GoogleContainerTools/kaniko/archive/refs/tags/v1.9.1.tar.gz
      tar xzf v1.9.1.tar.gz
      export PATH=$PATH:$PWD/kaniko 
  - gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS
  - gcloud services enable containerregistry.googleapis.com
  - gcloud --quiet config set project $GCP_PROJECT_ID
  - gcloud --quiet config set container/use_client_certificate False
  - echo "Running on $CI_PROJECT_DIR..."
  - mkdir -p /kaniko/.docker
  - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json

stages:
  - build
  
build:
  stage: build
  # image:
  #   name: gcr.io/kaniko-project/executor:latest
  #   entrypoint: [""]
  script:
    - echo "Start test $IMAGE "
    - /kaniko/executor
      --context "${CI_PROJECT_DIR}"
      --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
      --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
      --no-push
  only:
    - development

### Error Message

Updated property [container/use_client_certificate].
$ echo "Running on $CI_PROJECT_DIR..."
Running on /builds/vonomecode/vonome-official-website/vonome-website-project...
$ mkdir -p /kaniko/.docker
$ echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"},\"$CI_DEPENDENCY_PROXY_SERVER\":{\"auth\":\"$(printf "%s:%s" ${CI_DEPENDENCY_PROXY_USER} "${CI_DEPENDENCY_PROXY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
$ echo "Start test $IMAGE "
Start test gcr.io/useful-atlas-372807/vonome-official-website:latest2 
$ /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}" --no-push
/scripts-39705433-3695664429/step_script: line 167: /kaniko/executor: No such file or directory
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1
@waddles
Copy link

waddles commented Apr 13, 2023

Gitlab requires a shell, there is no shell in the gcr.io/kaniko-project/executor:latest image, you need to use the gcr.io/kaniko-project/executor:debug image. You are running your build: step on the image defined at the global scope, ie. google/cloud-sdk:latest which obviously does not have kaniko installed.

@aaron-prindle
Copy link
Collaborator

@ibnazher were you able to resolve this using the information @waddles provided?

As they mentioned it seems you attempted to use the kaniko executor binary on an image that did not contain it. Likely you would want to use the image - gcr.io/kaniko-project/executor:debug as mentioned above.

@aaron-prindle aaron-prindle added needs-follow-up ok-to-close? kind/question Further information is requested area/container For all bugs related to the kaniko container priority/p3 agreed that this would be good to have, but no one is available at the moment. labels Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/container For all bugs related to the kaniko container kind/question Further information is requested needs-follow-up ok-to-close? priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

No branches or pull requests

3 participants