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

Fix pkg not installable when entrypoint is not the last step #91

Merged
merged 1 commit into from
Aug 22, 2019

Conversation

tjamet
Copy link
Contributor

@tjamet tjamet commented Aug 12, 2019

From the docker inspect, ContainerConfig contains the configuration the the latest step of the docker build.
This means the entrypoint is only considered then it is the last step of the docker build.

However, the Config field contains the actual image configuration and the correct entrypoint regardless the position of the entrypoint

a Dockerfile of

FROM alpine
ENTRYPOINT ["sh"]
RUN echo hello world

gets a ContainerConfig of

"ContainerConfig": {
    "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"
    ],
    "Cmd": [
        "/bin/sh",
        "-c",
        "echo hello world"
    ],
    "ArgsEscaped": true,
    "Image": "sha256:a3c76edef3354652ffe1ce33205253dea58c6553d4c7bbb919bb3ff26bbb97d1",
    "Volumes": null,
    "WorkingDir": "",
    "Entrypoint": null,
    "OnBuild": null,
    "Labels": null
},

and a Config of

"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"
    ],
    "Cmd": null,
    "ArgsEscaped": true,
    "Image": "sha256:a3c76edef3354652ffe1ce33205253dea58c6553d4c7bbb919bb3ff26bbb97d1",
    "Volumes": null,
    "WorkingDir": "",
    "Entrypoint": [
        "sh"
    ],
    "OnBuild": null,
    "Labels": null
},

From the docker inspect, ContainerConfig contains the configuration the the latest step of the docker build.
This means the entrypoint is only considered then it is the last step of the docker build.

However, the Config field contains the actual image configuration and the correct entrypoint regardless the position of the entrypoint

a Dockerfile of

```
FROM alpine
ENTRYPOINT ["sh"]
RUN echo hello world
```

gets a ContainerConfig of

```
"ContainerConfig": {
    "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"
    ],
    "Cmd": [
        "/bin/sh",
        "-c",
        "echo hello world"
    ],
    "ArgsEscaped": true,
    "Image": "sha256:a3c76edef3354652ffe1ce33205253dea58c6553d4c7bbb919bb3ff26bbb97d1",
    "Volumes": null,
    "WorkingDir": "",
    "Entrypoint": null,
    "OnBuild": null,
    "Labels": null
},
```

and a Config of

```
"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"
    ],
    "Cmd": null,
    "ArgsEscaped": true,
    "Image": "sha256:a3c76edef3354652ffe1ce33205253dea58c6553d4c7bbb919bb3ff26bbb97d1",
    "Volumes": null,
    "WorkingDir": "",
    "Entrypoint": [
        "sh"
    ],
    "OnBuild": null,
    "Labels": null
},
```
@tjamet tjamet merged commit fca86f8 into master Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant