Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): configure bundling docker entrypoint (#12660)
Allow customizing the docker entrypoint for the bundling image. Note that the option `entrypoint` is a `string[]` which match up with nearly every container runtime. The problem is that `docker run` 's `--entrypoint` only accepts a string. If the entrypoint we specify is `["/bin/sh", "-c"]`, the final command should be like: `docker run --entrypoint /bin/sh some-img -c some commands`. I have do some experiments to prove this: ```sh $ docker run -it --rm --name test --entrypoint /bin/sh -c alpine ls invalid argument "alpine" for "-c, --cpu-shares" flag: strconv.ParseInt: parsing "alpine": invalid syntax See 'docker run --help'. $docker run -it --rm --name test --entrypoint "/bin/sh -c" alpine ls docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/sh -c\": stat /bin/sh -c: no such file or directory": unknown. $docker run -it --rm --name test --entrypoint /bin/sh alpine -c ls bin etc lib mnt proc run srv tmp var dev home media opt root sbin sys usr ``` One more thing: if one specify custom entrypoint but no custom commands, the default cmd for the image will not be presented. I do think it's a expected behavior for container runtime through. References: * [kubernetes - Define a Command and Arguments for a Container](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes) close #11984 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information