Please, next time, when you spontaneously add flags and remove flags or features that prevent starting IRIS in Docker, think about end-users, who would need, to run different versions of IRIS, it makes it more complicated to follow all those changes. One version does not work with flags, another does not work with this flag. We need something more stable. When I need to configure the CI process for multiple versions, now I should somehow decide which version has this flag and which has not.

Short answer, Yes. 

During docker build, just execute it, the same way, you doing anything when configure IRIS

While docker container starts, you can execute script, which will be called after start of IRIS

Just add it in the Dockerfile, trainmodel.sh, should contain iris session script to start model train

CMD ["-a", "/trainmodel.sh"]

Is it possible to get also some stability in containers?

Here is the list of tags available on containers.intersystems.com

requesting list . done
repository: intersystems/irishealth-community
tags:
- 2020.1.1.408.0
- 2020.3.0.221.0
- 2020.4.0.547.0
- 2021.1.0.215.3
- 2022.1.0.152.0
- 2022.1.0.164.0
- 2022.1.0.172.0

Where is 2021.2?

And for the licensed version

repository: intersystems/irishealth
tags:
- 2019.1.1.615.1
- 2019.1.3.722.0
- 2020.1.0.217.1
- 2020.1.1.408.0
- 2020.1.2.517.0
- 2020.2.0.211.0
- 2020.3.0.221.0
- 2020.4.0.547.0
- 2021.1.0.215.0
- 2021.1.2.338.0
- 2021.2.0.651.0
- 2022.1.0.152.0
- 2022.1.0.164.0
- 2022.1.0.172.0

The only place where available 2021.2 CE version, is on Docker Hub, which now says it's deprecated, without any announcements. Just closed one of the ways used to download images.