msv-lab / modus

A language for building Docker/OCI container images
GNU Affero General Public License v3.0
280 stars 9 forks source link

Clears cmd when setting entrypoint #175

Closed maowtm closed 2 years ago

maowtm commented 2 years ago

This is required so that experiment result image runs correctly.


According to https://docs.docker.com/engine/reference/builder/#entrypoint:

If CMD is defined from the base image, setting ENTRYPOINT will reset CMD to an empty value. In this scenario, CMD must be defined in the current image to have a value.

Note that Dockerfile allow defining CMD and ENTRYPOINT in any order, so CMD ["hello"]; ENTRYPOINT "echo" will actually set both the CMD and ENTRYPOINT so that the result is running echo hello. To simplify matter here we always reset cmd for now (we don't even have ::set_cmd yet).