Using the following Docker builder:
"builders": [
{
"name": "docker",
"type": "docker",
"image": "alpine",
"commit": true,
"run_command": ["-d", "-i", "-t", "--", "{{.Image}}", "/bin/sh"],
"changes": [
"ENTRYPOINT ['/opt/entrypoint.sh']"
]
}
]
Will build Docker images with the following entrypoint:
"Entrypoint": [
"/bin/sh",
"-c",
"/opt/entrypoint.sh"
],
This is unintuitive to most users and the following exec style should be documented in Packer:
"changes": ["ENTRYPOINT [\"/opt/entrypoint.sh\"]"]
No that's working correctly. You are using the shell form, but you expect the result from the exec form*)
$ cat issue-8117.json | jq ".builders[].changes"
[
"ENV ENV=/etc/profile",
"ENTRYPOINT [ \"/opt/entrypoint.sh\" ]"
]
$ docker inspect --format "{{ .Config.Entrypoint }}" sha256:327d061ee2d4a6375426a9d0684e464b564b5b5ea8e6ed1b0a33d276e5a1599e
[/opt/entrypoint.sh]
*) https://docs.docker.com/engine/reference/builder/#entrypoint
(EDIT: I see that you updated your OP to include this)
I have updated the code snippet. If you use the exec format it still doesn't work properly unless you use and escape double quotes.
I am just asking for it to be documented.
this was closed by #8240 :)
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
I have updated the code snippet. If you use the exec format it still doesn't work properly unless you use and escape double quotes.
I am just asking for it to be documented.