kernel:
  image: linuxkit/kernel:4.19.90
  cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
  - linuxkit/init:1d8e0532ca588c5ad0d9ca6038349a70bb7ac626
  - linuxkit/runc:c1f0db27e71d948f3134b31ce76276f843849b0a
  - linuxkit/containerd:751de142273e1b5d2d247d2832d654ab92e907bc
  - linuxkit/ca-certificates:v0.7
onboot:
  - name: sysctl
    image: linuxkit/sysctl:v0.7
  - name: dhcpcd
    image: linuxkit/dhcpcd:v0.7
    command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf", "-1"]
  - name: wg0
    image: linuxkit/ip:v0.7
    net: new
    binds:
      - /etc/wireguard:/etc/wireguard
    command: ["/usr/bin/lk-wg-config", "configure", "/etc/wireguard/wg0.conf"]
    runtime:
      interfaces:
        - name: wg0
          add: wireguard
          createInRoot: true
      bindNS:
          net: /run/netns/wg0
  - name: wg1
    image: linuxkit/ip:v0.7
    net: new
    binds:
      - /etc/wireguard:/etc/wireguard
    command: ["/usr/bin/lk-wg-config", "configure", "/etc/wireguard/wg1.conf"]
    runtime:
      interfaces:
        - name: wg1
          add: wireguard
          createInRoot: true
      bindNS:
          net: /run/netns/wg1
services:
  - name: getty
    image: linuxkit/getty:v0.7
    env:
     - INSECURE=true
    net: /run/netns/wg1
  - name: rngd
    image: linuxkit/rngd:02c555b50cd1887aa628836662d2eec54c0d7e81
  - name: nginx
    image: nginx:1.13.8-alpine
    net: /run/netns/wg0
    capabilities:
     - CAP_NET_BIND_SERVICE
     - CAP_CHOWN
     - CAP_SETUID
     - CAP_SETGID
     - CAP_DAC_OVERRIDE
files:
  - path: etc/wireguard/wg0.conf
    contents: |
      [Interface]
      Address = 192.168.2.1/24
      DNS = 192.168.2.2
      PrivateKey = KG7EKkHDkp7THfW5mOXcZzo3RbGAjq+ARMfJGFm5G1s=
      ListenPort = 51820
      [Peer] 
      PublicKey = ZP7h1OjA1oIAmsAvMKujp2RAAC/f0kY814b3Xq6j/0Y=
      AllowedIPs = 0.0.0.0/0
      Endpoint = 127.0.0.1:51821
  - path: etc/wireguard/wg1.conf
    contents: |
      [Interface]
      Address = 192.168.2.2/24
      PrivateKey = SCGCKDuTm4PMOw+LXdK/2s8mxnv145QHOohKRq3vc2A=
      ListenPort = 51821
      [Peer]
      PublicKey = AcS5t3PC5nL/oj0sYhc3yFpDlRaXoJ0mfEq6iq0rFF4=
      AllowedIPs = 0.0.0.0/0
      Endpoint = 127.0.0.1:51820
trust:
  org:
    - linuxkit
    - library
