Is it possible to mount an overlay fs inside a (privileged) docker container? At least my intuitive approach, which works fine outside of a container, fails:
> mkdir /tmp/{up,low,work,merged}
> mount -t overlay overlay -o lowerdir=/tmp/low/,upperdir=/tmp/up/,workdir=/tmp/work/ /tmp/merged/
mount: /tmp/merged: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
Additional information:
- Docker version 18.09.1, build 4c52b90
- Kernel 4.19.0-8-amd64
- Debian 10 (host and docker-image)
Found something that worked! Mounting the workdir and upperdir as tmpfs does the trick for me. Like so:
I'd still be interested in an explanation why creating an overlay w/o tmpfs fails within a docker container?