So in a compose file we can override the original CMD with the command instruction:
my-service:
image: some-image
command: "custom-command"
And I aware that we can chain multiple commands in a way like this: https://stackoverflow.com/a/30064175/5454794
However the image I use containes and Entrypoint+CMD in a exec form. And I need to preserve the argument defined in the CMD, but if I do any other instruction in the command will be threated as an argument for the entrypoint.sh
ENTRYPOINT [ "/opt/entrypoint.sh" ]
CMD ["-flag", "flag_value"]
So basically what I would like is to run the original ENTRYPOINT with its CMD, then run my script, which needs to be break out from this exec form hell.
edit: I can't modify the dockerfile.