Docker Community Forums

Share and learn in the Docker community.

Docker networking with bridge network as well host access

We are currently running docker on private subnet with a specified ip pool.

We now have a requirement to support access to a service running on the host running docker at .

What is the best to bring up such a docker that is in a bridge network with a private ip pool and at the same time be able to query the host service running on the host? i.e have both bridge network and a route to access the service running at the above ip.

Can this be done during docker bring up using docker-py?

% docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 2
Server Version: 17.12.1-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Volume: local nvidia-docker
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9b55aab90508bd389d7654c4baf173a981477d55
runc version: 9f9c96235cc97674e935002fc3d78361b696a69e
init version: 949e6fa
Security Options:
Profile: default
Kernel Version:
Operating System:
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 480.3GiB
Docker Root Dir: /local/docker
Debug Mode (client): false
Debug Mode (server): false
Experimental: false
Insecure Registries:
Live Restore Enabled: false