That publishes/maps the container’s port 8080 as both 8031 and 8032 on the host. I didn’t know that this was even possible (assuming you’re not seeing any errors). I assume 8032 should be mapped to something else in the container?
Yep, possible, you can map as many host ports to a single container port as you want, thought each mapped port will delay the container start. Shouldn’t be a problem for a couple of ports, but definitly gets painfull when you try to map a range of 100 ports.
Let me make some assumptions: badsmoke/mjpg-streamer:1.0.1 binds port 8080 and since you run it twice and both hook into the network of service:octoprint, there is a colision and only one of the mjpg-streamer containers actualy is available. You will want to check if mjpg-streamer has a variable to modify the service port, change it and then modify one of the published ports accordingly.
All container use the same network namespace and thus the very same network interface and container ip. What is true for any sort of network interface ip remains true in this case: a port can only be bound once on a network ip.