services:
xx:
container_name: "xx"
image: my_image
network_mode: host
extra_hosts:
- "ims.gd.chinamobile.com:162.242.195.82" #host and ip
- "ims.sbc1.chinamobile.com ims.sbc2.chinamobile.com:50.31.209.229"
logging:
driver: "json-file"
options:
max-file: "10"
max-size: "200m"
restart: always
env_file: ./.env
ulimits:
core: -1
privileged: true
stdin_open: true
tty: true
volumes:
- ./data/log:/var/log
搞定!
进到容器,`cat /etc/hosts`,正是上面配置的内容
再定义一个全局变量, sip_gethostbyname=true
现在配置一个向 IMS 注册的 Fs 网关,就易如反掌了