TritonDataCenter / sdc-docker

Docker Engine for Triton
Mozilla Public License 2.0
182 stars 49 forks source link

Getting "remapping of port numbers not allowed" #76

Closed cmacrae closed 8 years ago

cmacrae commented 8 years ago

This is definitely down to user error, but I cancelled the a docker run process whilst it was provisioning, and now I can't start a container using the image I want to deploy.

My initial run was as follows:
docker run -d --name gogs -p 10022:22 -p 10080:3000 gogs/gogs Which I cancelled prematurely - now if I run the same, or even try different "external" port maps, I receive the following:
docker: Error response from daemon: publish port: remapping of port numbers not allowed (a49700a0-ff0f-11e5-a93f-39fad847bf8e).

I'd like to understand how to fix this - I tried reprovisioning the docker API endpoint zone on the headnode, and the docker hostvolume zones on the compute nodes, but I'm guessing this data must be recorded elsewhere.

Thanks in advance for any help on this.

misterbisson commented 8 years ago

I don't believe the cancelled provisioning attempt has any effect on this, but you should docker ps -a to see what actually provisioned.

As for the port remapping error, that's entirely accurate given the docker run ... example you shared. See https://github.com/joyent/sdc-docker/blob/master/docs/api/commands/run.md#divergence:

-P, --publish-all, -p, and --publish behave slightly differently thanks to each container having a complete IP stack with one or more virtual NICs. See networking.

In short, you can do -p 10080 or -p 3000, but not -p 10080:3000.

cmacrae commented 8 years ago

@mistrrbisson - Ah, okay. Great, thanks for your response. I'll be sure to read through the divergence documentation