openshift / openshift/imagebuilder

exec: "sleep 86400": executable file not found in $PATH

Open
#68 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lifecycle/frozen
Dominant language
Go
Stars
133
Forks
77
PR merge metrics
No merged PRs in 30d

Description

I must be doing something wrong here but can't figure out what.

With imagebuilder from latest head, and docker-1.13.1-51.git4032bd5.fc27.x86_64

$ imagebuilder -t foo -f Dockerfile.min .
--> FROM fedora:27 as 0
--> RUN touch /etc/foo
--> Committing changes to foo ...
--> Done
$ docker run -it --rm foo 
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"sleep 86400\": executable file not found in $PATH".
$ docker run -it --rm foo /bin/bash
[root@7e2cdeabd622 /]# exit
$ docker run -it --rm foo sleep 1
$

First of all, where did "sleep 86400" come from? fedora:27 has no Cmd or Entrypoint set. foo does.

$ docker run -it --rm fedora:27
/usr/bin/docker-current: Error response from daemon: No command specified.
See '/usr/bin/docker-current run --help'.
$ docker inspect foo
[
    {
        "Id": "sha256:948b2333e11c0dfbedf4bde7e7a7fe6749376dd5d5fae112992edfa600838ad8",
        "RepoTags": [
            "foo:latest"
        ],
        "RepoDigests": [],
        "Parent": "sha256:9110ae7f579f35ee0c3938696f23fe0f5fbe641738ea52eb83c2df7e9995fa17",
        "Comment": "",
        "Created": "2018-04-18T19:01:37.421678496Z",
        "Container": "fc1eb310d84b08683a2eab434268e46313bdf46b2a533606e4cdbed1a5e7727e",
        "ContainerConfig": {
            "Hostname": "fc1eb310d84b",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DISTTAG=f27container",
                "FGC=f27",
                "FBR=f27"
            ],
            "Cmd": [
                "sleep 86400"
            ],
            "Image": "fedora:27",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "/bin/sh",
                "-c"
            ],
            "OnBuild": null,
            "Labels": {}
        },
        "DockerVersion": "1.13.1",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "DISTTAG=f27container",
                "FGC=f27",
                "FBR=f27"
            ],
            "Cmd": [
                "sleep 86400"
            ],
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [],
            "OnBuild": null,
            "Labels": {}
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 235250693,
        "VirtualSize": 235250693,
        "GraphDriver": {
            "Name": "overlay2",
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/70bea816b920919e3afcdaca1f7c572c83308f4bee6379450e17acba57da28ff/diff",
                "MergedDir": "/var/lib/docker/overlay2/6e1b01b002e68b2410fe67bcfee1bc7647346563074c82bc1abc534681459b01/merged",
                "UpperDir": "/var/lib/docker/overlay2/6e1b01b002e68b2410fe67bcfee1bc7647346563074c82bc1abc534681459b01/diff",
                "WorkDir": "/var/lib/docker/overlay2/6e1b01b002e68b2410fe67bcfee1bc7647346563074c82bc1abc534681459b01/work"
            }
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:39bae602f7539e626f6894ecded6d12a6c56745dbab9aee940e258c766e090e8",
                "sha256:de41557ebc416b99c4bb90ae5e39f4c451055236db8aff0cbe10f8206a275039"
            ]
        }
    }
]

Second, why does it fail to run that?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with imagebuilder, Dockerfile.min, and the documented docker run, docker inspect, and docker run ... sleep 1 commands. Trace where the generated Cmd and Entrypoint values come from and compare them with the base image metadata. Done means the cause of the unexpected command and failed startup is identified and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.