Documentation for network_mode & Custom Docker networks

Hey folks,

In the doc I could only find this :

Network mode

Setting network_mode to host allows the container to share the same network namespace as the host OS. When this is set, any ports exposed on the container will be exposed locally on the device. This is necessary for features such as bluetooth.

What are other mode available ? bridge ?

Also is there a doc somewhere for creating custom docker network at the balena OS side ?

The reason for this is we wish to allow container to be accessible ONLY from some interfaces. (Our Pi has 3 connected Interfaces (wlan0 / eth0 and eth1 via an extra dongle)

We want some container to expose port only on some network.

For example :
container: trucmuche
expose port 443 on eth0-linked network (can be a docker network with access to only that side).
expose no port on the eth1-linked network BUT use this as the internet out connectivity.

Thanks !

Hi, We support the docker compose 2.1 network specifications but only for the default driver as specified here: Hopefully this will let you achieve what you are trying to accomplish, let us know.

1 Like

Thank @alanb128 .
If we can create custom network from docker-compose that should do.