So I'm running a private registry in a remote server e.g. 51.15.235.12:5000
, and locally pushing docker images to that registry. I'm trying to start a container using the host IP with network_mode host, but the ip of the container is something like 172.17.0.1
.
This is the docker-compose:
version: '2'
services:
rsi:
container_name: rsi
image: localhost:5000/rsi:1.0
restart: on-failure:10
depends_on:
- geoserver
# - rsi-db
network_mode: host
# Geoserver
geoserver:
container_name: geoserver
restart: always
image: localhost:5000/geoserver:1.0
network_mode: host
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
environment:
- GEOSERVER_LOG_LOCATION=/opt/geoserver/data_dir/logs/geoserver.log
The localhost-IP here is 51.15.235.12
, but when I enter the rsi-container I'm getting this when I run ifconfig
:
docker0 Link encap:Ethernet HWaddr 02:42:E5:09:B4:E9
inet addr:172.17.0.1 Bcast:172.17.255.255 Mask:255.255.0.0
Why isn't the docker0 interface IP set to the local host IP i.e. 51.15.235.12
?