LXD 3.0 Container with Static IP

  • Use init instead of launch to create new container.
    lxc init ubuntu:18.04 c1
    
  • Attach network
    lxc network attach lxdbr0 c1 eth0
    
  • Configure static IP
    lxc config device set c1 eth0 ipv4.address 10.10.1.250
    
  • Enable docker
    lxc config set docker01 security.nesting true
    lxc config set docker01 security.privileged true
    
  • Start docker
    lxc start c1
    

Reference:
https://stgraber.org/2016/10/27/network-management-with-lxd-2-3/
https://blog.ubuntu.com/2016/03/22/lxd-2-0-your-first-lxd-container

Written on June 24, 2018