After a lot of digging trying to do this myself, I found myself in the /usr/local/bin/cosmos/start.sh
file on the cosmos emulator. In that file, it executes Microsoft.Azure.Cosmos.Emulator.exe
with a variable at the end for any other parameter that you want.
So by adding an environment variable passing port, you can run this on any port that you want. Keep the enable preview flag because this is the default value for this parameter.
AZURE_COSMOS_EMULATOR_ARGS='/port=18081 /enablepreview'
So the full docker run might be something like:
docker run --publish 18081:18081 --publish 10250-10255:10250-10255 -e AZURE_COSMOS_EMULATOR_ARGS='/port=18081 /enablepreview' -e AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE=192.168.1.10 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest