openwrt / docker

Docker containers of the ImageBuilder and SDK
GNU General Public License v2.0
463 stars 76 forks source link

rootfs persistence #80

Open hansbogert opened 3 years ago

hansbogert commented 3 years ago

what directories need to be made a (docker) volume, in order to make the configuration persistent?

Rast1234 commented 3 years ago

Here's ideas i explored:

My Dockerfile and docker-compose:

FROM scratch
CMD /sbin/init
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
version: "3.9"
services:
  openwrt:
    container_name: openwrt
    # image built from above Dockerfile
    image: openwrt:empty
    # my network setup... replace with yours
    cap_add: [NET_ADMIN] 
    network_mode: none
    # mounting every folder from original container
    volumes:
      - /mnt/stuff/docker/openwrt/bin:/bin
      - /mnt/stuff/docker/openwrt/etc:/etc
      - /mnt/stuff/docker/openwrt/lib:/lib
      - /mnt/stuff/docker/openwrt/lib64:/lib64
      - /mnt/stuff/docker/openwrt/mnt:/mnt
      - /mnt/stuff/docker/openwrt/overlay:/overlay
      - /mnt/stuff/docker/openwrt/rom:/rom
      - /mnt/stuff/docker/openwrt/root:/root
      - /mnt/stuff/docker/openwrt/sbin:/sbin
      - /mnt/stuff/docker/openwrt/tmp:/tmp
      - /mnt/stuff/docker/openwrt/usr:/usr
      - /mnt/stuff/docker/openwrt/var:/var
      - /mnt/stuff/docker/openwrt/www:/www