在根服务器上拥有自己的IP的Docker容器

我有一个debian根服务器的辅助IP,我想用于一个docker的PHP / Apache的容器。 服务器IP:80.XXXX由主机分配的新/ IP:46.XXX

我想要所有的呼吁46.XXX:80 / 443结束docker集装箱内,并试图:

docker run -d --name php-recent -p 46.XXX:80:80 -p 46.XXX:443:443 my-php-app 

返回docker: Error response from daemon: failed to create endpoint php-recent on network bridge: Error starting userland proxy: listen tcp 46.XXX:443: bind: cannot assign requested address.

我尝试执行ip route add 46.XXX/32 dev docker0 ,然后激活IP4转发sysctl -w net.ipv4.ip_forward=1 – >没有帮助。

在debian系统上的ifconfing响应是这样的

 br0 Link encap:Ethernet HWaddr 6c:* inet addr:80.XXX Bcast:85.YYY Mask:255.255.255.224 inet6 addr: fe80::x:x:x:x/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2409691 errors:0 dropped:0 overruns:0 frame:0 TX packets:2995577 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1317423411 (1.2 GiB) TX bytes:2053704233 (1.9 GiB) br64 Link encap:Ethernet HWaddr e6:* inet addr:172.30.xx Bcast:172.xx255 Mask:255.255.255.0 inet6 addr: fe80::x:x:x:x/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:1926 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:165588 (161.7 KiB) docker0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0 inet6 addr: fe80::e86c:1aff:fe23:b64b/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:136 errors:0 dropped:0 overruns:0 frame:0 TX packets:615 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:36853 (35.9 KiB) TX bytes:53198 (51.9 KiB) eth0 Link encap:Ethernet HWaddr 6c:* UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2902930 errors:0 dropped:8025 overruns:0 frame:0 TX packets:2997498 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1386678228 (1.2 GiB) TX bytes:2053792599 (1.9 GiB) Interrupt:42 Base address:0x6000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:631737 errors:0 dropped:0 overruns:0 frame:0 TX packets:631737 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:252420138 (240.7 MiB) TX bytes:252420138 (240.7 MiB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.8.0.1 PtP:10.8.0.2 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)