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

not found error when add manifest-tool into kaniko #2794

Open
gaussye opened this issue Oct 13, 2023 · 2 comments
Open

not found error when add manifest-tool into kaniko #2794

gaussye opened this issue Oct 13, 2023 · 2 comments
Labels
area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) issue/missing-files kind/question Further information is requested needs-follow-up priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@gaussye
Copy link

gaussye commented Oct 13, 2023

Actual behavior
A clear and concise description of what the bug is.

I want to move the manifest-tool into kaniko for multi-arch build. However when i copied manifest-tool into kaniko image, the maniest-tool can not run.

Expected behavior
A clear and concise description of what you expected to happen.

To Reproduce
Steps to reproduce the behavior:

  1. Create a docker file:
    FROM --platform=$TARGETPLATFORM golang:1.20 AS builder
    RUN go install golang.org/x/tools/cmd/cover@latest
    && go install golang.org/x/lint/golint@latest
    ENV REGISTRY_COMMIT=a4d9db5a884b70be0c96dd6a7a9dbef4f2798c51
    RUN set -x
    && mkdir -p /go/src/github.com && cd /go/src/github.com
    && git clone https://github.com/estesp/manifest-tool
    && cd manifest-tool && make binary
    FROM --platform=$TARGETPLATFORM gcr.io/kaniko-project/executor:debug
    COPY --from=builder /go/src/github.com/manifest-tool/manifest-tool /usr/local/bin

  2. build and push to docker
    docker buildx build --platform linux/arm64,linux/amd64 -t gaussye/kaniko-full . --push

  3. Run it on kubernetes:
    apiVersion: v1
    kind: Pod
    metadata:
    name: kaniko
    spec:
    nodeSelector:
    containers:

    • name: kaniko
      image: gaussye/kaniko-full:latest
      command:
      • sleep
        args:
      • 99d
        restartPolicy: Never
  4. kubectl exec -it manifest-tool -n jenkins -- /bin/sh
    /kaniko # ls
    docker-credential-acr-env docker-credential-gcr manifest-tool warmer
    docker-credential-ecr-login executor ssl

run manifest-tool get not found error, however the manifest-tool is there.
/kaniko # manifest-tool
/bin/sh: manifest-tool: not found

Additional Information

  • Dockerfile
    Please provide either the Dockerfile you're trying to build or one that can reproduce this error.
  • Build Context
    Please provide or clearly describe any files needed to build the Dockerfile (ADD/COPY commands)
  • Kaniko Image (fully qualified with digest)

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@aaron-prindle aaron-prindle added kind/question Further information is requested needs-follow-up priority/p3 agreed that this would be good to have, but no one is available at the moment. area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) issue/missing-files labels Oct 20, 2023
@aaron-prindle
Copy link
Collaborator

aaron-prindle commented Oct 20, 2023

Hi @gaussye, can you specify how you are trying to call manifest-tool? From the above it seems that manifest-tool might not be in the $PATH that you are using when attempting to call the tool.

Can you clarify, the manifest-tool that cannot be found is attempting to be called in a Dockerfile kaniko is building eg?:

...
RUN manifest-tool ...
...

Additionally can you provide/attempt the following to help us debug this:

  • The PATH env var being used in the container run
  • Attempt to use manifest-tool via a fully qualified path (/kaniko/manifest-tool) vs manifest-tool

@artemptushkin
Copy link

artemptushkin commented Jan 4, 2024

@gaussye did you fix it? I have the same error whatever I do

  • the binary exists in a directory
  • the directory is in the $PATH
  • which finds the binary
  • "no such file or directory" when we run it

This is all I do in a built image, not "RUN" inside the Dockerfile

other two errors:

/workspace # 
/workspace # /kaniko/manifest-tool
/bin/sh: /kaniko/manifest-tool: not found
/workspace # sh /kaniko/manifest-tool
/kaniko/manifest-tool: line 6: syntax error: unterminated quoted string

the binary exists in the kaniko dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/filesystems For all bugs related to kaniko container filesystems (mounting issues etc) issue/missing-files kind/question Further information is requested needs-follow-up 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