Container port keeps incrementing

I am new to both docker and portainer.

I installed portainer and used the built in app template facility to install the Remind container.

It works fine but every time I restart the container using portainer, the external port is getting incremented. why is that happening and how can I stop it from happening?

Hi,
I assume your are talking about “Redmine” template application (not “Remind”) ; and you reached something like this:


Internal port is set dynamically by Docker who checks it’s a free port not assigned (ex: 32768) and pointing on internal port (in this case: 3000)

You can assign external exposed ports in command line only (not on templates apps) using -p command or in a docker compose way: https://hub.docker.com/_/redmine

I ended up removing the docker container and creating it again in order to set the port to 3030 and now it doesn’t increment. I think its because I was using one of the portainer app templates and didn’t modify that, so obviously it set something up in docker that was dynamically looking for a port. I don’t know why it needed to keep incrementing it. But I had been hoping there was a way for me to change that behavior without having to remove and re-install the docker container completely. I’m kind of new to docker so maybe there is an easy way but I wasn’t able to figure it out and I have now already destroyed and recreated the container using the portainer app template…but this time I modified the port to set it expclitly to 3030 before having portainer install it.