Docker Custom Bridge Network and ZeroMQ

I have a simple Dockerfile as shown below. I run 2 containers with the following commands.

# Create Docker network to operate on
docker network rm company
docker network create --subnet=172.18.0.0/16 company

docker run --rm --log-driver=journald --net company --ip 172.18.0.22 -p 5556:5556 -v /docker-test/docker-test-subscriber/:/test:ro -d $IMAGE_NAME:v1.3 python /test/subscriber.py

docker run --rm --log-driver=journald --net company --ip 172.18.0.23 -v /docker-test/docker-test-publisher/:/test:ro -d $IMAGE_NAME:v1.3 python /test/publisher.py

Dockerfile:

FROM python:3.8-slim-buster

COPY git /home/git

WORKDIR /home

RUN apt-get update -y && apt-get --no-install-recommends install build-essential pkg-config libzmq5 -y && 
    cd git && python3 setup.py install && apt remove --purge build-essential pkg-config -y && 
    apt auto-remove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

The problem is that with my custom bridge network, the publisher can not connect to the subscriber ( the subscriber never receives any messages ). However, if I launch the containers as shown below, on the default Docker bridge network, it works great ( I just have to specify the 172.17.0.2 address in the publisher ):

docker run --rm --log-driver=journald -p 5556:5556 -v /docker-test/docker-test-subscriber/:/test:ro -d $IMAGE_NAME:v1.3 python /test/subscriber.py

docker run --rm --log-driver=journald -v /docker-test/docker-test-publisher/:/test:ro -d $IMAGE_NAME:v1.3 python /test/publisher.py

Why does it not work with the custom bridge network / how can I make it work? Thank you.

Source: StackOverflow