The code to set the default values for cmd/entrypoint in order to inherit what was set from the original image was working well if both the cmd and entrypoint were set, but if the entrypoint was null, the resulting image would inherit the temporary container's, which was /bin/sh.
This resulted in some images being built incorrectly, with /bin/sh as entrypoint, regardless of what we had as CMD/ENTRYPOINT in this case.
To fix this issue, we return a JSON array with an empty string if the entrypoint or the CMD was null in the image, and we haven't decided to override it.
This effectively forces the resulting image to have an equivalent of null as the CMD/ENTRYPOINT, which makes the final image honour the behaviour from the source image.
Closes #176
cc: @gardar for insights, as you had submitted the implementation originally, this fixes the case where there's some null in the base image, please refer to the linked issue for a summary of the problem, if you have suggestions regarding my code please feel free to share!
The code to set the default values for cmd/entrypoint in order to inherit what was set from the original image was working well if both the cmd and entrypoint were set, but if the entrypoint was null, the resulting image would inherit the temporary container's, which was /bin/sh.
This resulted in some images being built incorrectly, with
/bin/sh
as entrypoint, regardless of what we had as CMD/ENTRYPOINT in this case.To fix this issue, we return a JSON array with an empty string if the entrypoint or the CMD was null in the image, and we haven't decided to override it.
This effectively forces the resulting image to have an equivalent of null as the CMD/ENTRYPOINT, which makes the final image honour the behaviour from the source image.
Closes #176
cc: @gardar for insights, as you had submitted the implementation originally, this fixes the case where there's some
null
in the base image, please refer to the linked issue for a summary of the problem, if you have suggestions regarding my code please feel free to share!