Open hansbogert opened 3 years ago
Here's ideas i explored:
/etc
and /bin
, something will break sooner or later./
. Docker does not allow this unfortunately./run
and /proc
. My current workaround is that i mount everything copied from image as a separate volume.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
what directories need to be made a (docker) volume, in order to make the configuration persistent?