Is it possible to assign a static public ip to a Docker Container?

前端 未结 3 1850
天涯浪人
天涯浪人 2021-01-28 02:38

I have been trying to assign one of my five public ip\'s to my docker container. It seems like this should be possible because of the nature of docker and its uses. I found this

3条回答
  •  旧巷少年郎
    2021-01-28 03:35

    The only way I know of to have a docker container use a static ip is using pipework.

    Assuming you mean acquiring a DHCP lease and showing up on your router page -- Nothing comes to mind with docker. I don't think that is "the docker way". It's pretty simple with nspawn if you are using a systemd based distro, FWIW.

提交回复
热议问题