The COMMAND instruction is exactly the same as what is passed at the end of the docker run , for example echo "hello world" in:
docker run debian echo "hello world"
The command is interpreted as the argument ENTRYPOINT image, which in the debian case is equal to /bin/bash . In the case of your image, it goes to this script . If you look at the script, your command will simply be passed to the shell. I would expect that any command that you pass will succeed, but the container will exit after your command completes. Note that the default command is installed in the Docker file on the CMD ["prosodyctl", "start"] , which, apparently, is a lengthy process that starts the server.
I'm not sure how Prosody works (or even what it is), but I think that you probably want to either display in a configuration file that contains your users, or set up a data container to save your configuration. The first solution would be to add something like:
volumes: - my_prosodoy_config:/etc/prosody
To the docker-compose file, where my_prosody_config is the directory where the configuration files are stored.
In the second solution, you may need to first create a data container, for example:
docker run -v /etc/prosody -v /var/log/prosody --name prosody-data prosody-docker echo "Prosody Data Container"
(The echo should end, leaving you with a stopped container with volumes configured for configuration and logs. Just make sure you don't docker rm this container by accident!)
Then in the docker-compose file add:
volumes_from: - prosody-data
We hope you can add users by running docker exec , as you did before, then running prosodyctl register on the command line. But it depends on how the prosody and the image behave.