0

When I add a docker to a bridge network, normally (when doing it on my local pc) I can leave exposed ports "open" without connecting them to an external port.

This has as advantage that the port itself can only be used from within the network the docker is used, yet invisible to the outside world. Adding a strong layer of protection while making managing of groups of dockers easier. (Non external ports only have to be unique within the network).

However when I add a docker through the GUI in synology - even if I add said dockers to a network and remove them from the default network -, I need to supply a free, unique port per docker. Even if I don't provide anything synology will provide a port by itself using auto.

How can I prevent this and use dockers only within the network? - In my use case I'd have 4 dockers within a network with only a single docker facing "outwards": a postgres docker, a redis docker, a node docker and the outwards facing docker: an nginx docker acting as reverse proxy & providing the static files.

0

There are actually two ways you can do this: from the GUI or from CLI.

GUI

Modify existing containers

In the container page, select the container you want to modify (disable port-mapping), and click "Edit" (stop it first if it's running). first step screenshot

Now in the "Port Settings" tab, select the port mapping you'd like to remove, and then click the minus sign. Apply your settings. second step screenshot

Create a new container

You can find the same settings from "Advanced Settings" in the launch wizard. launching new containers

CLI

SSH into your DSM using an admin account, run sudo docker run like you would on your local machine.

2
  • Can one ssh into a docker image from the gui (and will it show in the GUI if ran/started through an ssh connection)
    – paul23
    Sep 1 '19 at 9:00
  • @paul23 Can one ssh into a docker image from the gui Do you really mean ssh into the docker image? If you set up proper port-forwarding then yes, but not from GUI. However, you probably mean ssh into the Synology DSM, right? Of course you can. Also, docker containers started via CLI will show up in the GUI.
    – zypA13510
    Sep 1 '19 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.