Comments (4)
Docker supports several types of network drivers for running containers. The most common ones are:
bridge
- The default network driver, which allows containers on the same network to communicate with each other by hostname. Docker recommends to setup a user-defined bridge network instead of the default bridge network.host
- The container uses the host's network directly. This is the easiest way to setup stand-alone containers.overlay
- Overlay networks connect multiple Docker daemons together and enable swarm services to communicate with each other.macvlan
- Available on Linux hosts, Macvlan networks allow you to assign a MAC address to a container, making it appear as a physical device on your network. It also allows to specify a specific IP address on which the container should be available.
Setting up Docker on your Synology with the synology-docker script might result in difficulty connecting with containers in bridge mode. Potential workarounds are:
- Deploy your service in a Docker stack, for example
docker-compose config | docker stack deploy -c - <stack-name>
. The exposed ports on the services are available from your host byLOCAL_HOST_IP:PORT
. - Setup a
macvlan
network and connect your containers to this network. An instruction is available here.
from synology-docker.
Do you know what is the root cause of this behavior ?
from synology-docker.
I suspect it has to do with the iptables
configuration. Although the installation script sets up Docker's default routing rules, it appears Synology requires additional rules to get it working properly.
Setting up the macvlan driver in the synology-pihole gave me some clues, as I ran into a similar issue. Adding a static route did the trick for the macvlan configuration: ip route add "$PARAM_PIHOLE_IP/32" dev "$PARAM_VLAN_NAME"
. However, it requires some additional research to get this right.
from synology-docker.
As pointed out by @siddjellali, adding iptables -P FORWARD ACCEPT
should fix the networking issues. This forum post gives some additional pointers. I'll update the script to incorporate them. Below an excerpt of the solution:
- Enable forwarding of all traffic from docker (i.e. egress traffic) using the command
sudo iptables -P FORWARD ACCEPT
- Add the iptables command to the
/var/packages/Docker/scripts/start-stop-status
script after the iptables modules are installed. This will restore the default traffic forwarding behavior whenever you restart docker:
# install modules
iptablestool --insmod "${DockerServName}" ${InsertModules}
# add this line
sudo iptables -P FORWARD ACCEPT
from synology-docker.
Related Issues (20)
- Ensure folder `/var/lib/docker/volumes` exists
- Allow graceful stopping of script during Docker daemon start/stop
- Support stacked parameters
- Cannot reach containers attached to user-defined bridge network HOT 17
- Folder location HOT 1
- Binaries not installed HOT 5
- Adjust update of log driver configuration HOT 8
- Known issues
- Add flag to stop containers before updating
- Store logs on disk
- Lost of connectivity after reboot HOT 10
- [BUG] After update, Docker service doesn't start. HOT 10
- New package release on synology website HOT 1
- Add support for DSM 7
- [FeatureRequest] Add nvidia-docker2 support HOT 7
- Updating to DSM 7 HOT 7
- [BUG] Docker-compose download error HOT 3
- Can't make update in DSM 7.2-64561 HOT 4
- DSM 7.1.1 (DS1813+) and Docker v24.0.6 HOT 3
- Offering help, + DSM 7.2 available here in the meantime HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from synology-docker.