My host machine application is trying to establish a SCTP connection at port 38412 to a docker container which is running SCTP server at port 38412. I am mapping and publishing the ports but getting an error. My host application is timing out at the following check:
if (connect(fd, (struct sockaddr*)&myaddr,sizeof(myaddr))== -1){
higLog("SCTP CLIENT connect failed, port %d, Error %s",
port, strerror(errno));
return -1;
}
Error Connection timed out
My DockerFile looks something like this.
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y \
dialog \
apt-utils \
iputils-ping \
inetutils-traceroute \
iproute2 \
curl \
dnsutils \
nano \
build-essential \
libcpprest-dev \
libboost-all-dev \
libssl-dev \
cmake \
libyaml-cpp-dev \
libsctp1 \
libsctp-dev \
tre-agrep \
libtre5 \
libtre-dev \
libhiredis-dev \
gcovr \
lcov \
curl \
make \
binutils \
libcurlpp-dev \
libcurlpp0 \
libjsoncpp-dev
COPY . $HOME/src/D1/Func
RUN cd src
RUN mkdir utility_library
RUN cd ..
RUN mv src/D1/Func/utility_library src/utility_library
WORKDIR "$HOME/src/D1/Func"
EXPOSE 80
CMD ["/bin/bash", "-c", "cmake .;make -j16;./build/bin/Func eth0"]
And running this container using the following docker-run command:
docker run --name con1 --net Network1 --ip 10.0.0.21 -p 127.0.0.1:38412:38412/sctp sourav/image1:1.0.0
Can I get some ideas on how to solve it ?