Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Executable file not found in $PATH #3

@eohtake

Description

@eohtake

Hello,
Running a container with an image built from this Dockerfile generates an error:

Missing binary name when copy to /usr/local/bin/ folder
docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: "clair": executable file not found in $PATH": unknown.

I did a little investigation and found that on the Dockerfile, the binary name is missing in the destination folder, so the copy operation is overwriting the /usr/local/bin folder.

The correct copy line should be:
COPY --from=0 /gopath/src/clair/clair /usr/local/bin/clair

Below some evidence that the bin folder became the Clair binary:

~ # cd /usr/local/bin
/bin/sh: cd: can't cd to /usr/local/bin: Not a directory
~ #
~ #
~ #
~ # cd /usr/local
/usr/local #
/usr/local #
/usr/local #
/usr/local # ls
bin    lib    share
/usr/local #
/usr/local #
/usr/local #
/usr/local # ./bin
Error: incorrect usage

Usage: clair-scanner [OPTIONS] IMAGE

Scan local Docker images for vulnerabilities with Clair

Arguments:
  IMAGE=""     Name of the Docker image to scan

Options:
  -w, --whitelist=""                    Path to the whitelist file
  -t, --threshold="Unknown"             CVE severity threshold. Valid values; 'Defcon1', 'Critical', 'High', 'Medium', 'Low', 'Negligible', 'Unknown'
  -c, --clair="http://127.0.0.1:6060"   Clair URL
  --ip="localhost"                      IP address where clair-scanner is running on
  -l, --log=""                          Log to a file
  --all, --reportAll=true               Display all vulnerabilities, even if they are approved
  -r, --report=""                       Report output file, as JSON
  --exit-when-no-features=false         Exit with status code 5 when no features are found for a particular image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions