0

My docker container (sctp server) is running on sctp with port number 36412. However, my sctp client on the host machine unable to communicate with the container. How do I expose this port from container to host? Is it not same as TCP/UDP? When I run docker run -p 36412:36412 myimage, I get below error.

Invalid proto: sctp
mdasari
  • 423
  • 4
  • 11

2 Answers2

4

From reading source code, the general form of the docker run -p option is

docker run -p ipAddr:hostPort:containerPort/proto

Critically, the "protocol" part of this is allowed to be any of tcp, udp, or sctp; it is lowercased, and defaults to tcp if not specified.

It looks like for your application, you should be able to

docker run -p 36412:36412/sctp ...
David Maze
  • 130,717
  • 29
  • 175
  • 215
  • Thakns David for the answer. I understand the syntax you mentioned. I tried that already. Apparently, docker does not have support for sctp protocol. I am getting "Invalid proto: sctp". Not sure if there is an alternative. – mdasari Aug 14 '18 at 20:03
-1

Use the -p flag when running to to map an open port on your host machine to the container port. The below example maps port 36412 on the host to 36412 in the container.

docker run -p 36412:36412 mysctpimage

To view the ports running on your container and where they are mapping to:

docker port <containerId>

This will tell you what port and protocol the container is mapping to your host machine. For example running a simple WebApi project may yield: 80/tcp -> 0.0.0.0:32768

Docker Port Documentation

How to publish or expose a port when running a container

Wesley Rolnick
  • 871
  • 4
  • 11