Hey @Maksym,
Sorry for the double post here but I did find these articles on our forums which may help, I have never used Docker Swarm so unsure if the suggestions in here would be suitable but they may be easier than the run a script step for now. Everything I have seen from the Octopus side points to the fact we were looking at implementing Docker Swarm templates but I think the focus has been more on Kubernetes since that is what most of our customers use.
- Docker Swarm Step Template
- GitHub issue from the link above - How to Customize Moby Linux Instances · Issue #96 · docker-archive/for-aws · GitHub
- Docker Registry as Input for Swarm Deploy
The third forum post is what I think you are doing already so that one may not help.
I did contact the engineers but I wont hear back from them until at least tomorrow as they are based in Australia so wont be online until later on tonight.
Kind Regards,
Clare