creating overlayFS mount inside Centos8 container, hosted by Debian fails with "wrong fs type, bad option"

  centos8, docker, dockerfile, overlayfs

Im running Debian10.06 VirtualBox on Windows10 Professional.
Inside Debian10.06 i have Docker installed, and i’m building an image "from Centos8"

When running the container and executing the following in its terminal;

cd /tmp
mkdir lower upper workdir overlay
mount -t overlay -o 
> lowerdir=/tmp/lower,
> upperdir=/tmp/upper,
> workdir=/tmp/workdir 
> none /tmp/overlay

i get

mount: /tmp/overlay: wrong fs type, bad option, bad superblock on none, missing codepage or helper program, or other error.

(instead of ‘none’ i also specified ‘overlay’ as some documents suggest, but i get the same result)

What am i missing?

i build and run the container as follows;

docker build --rm -t core .

docker run --name core-1 --privileged=true -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /tempdocker/run:/run -v /tempdocker/out:/setup/out -p 8080:8080 -p 8081:8081 core

Maybe the next info is of some help;

Device     Boot  Start       End   Sectors  Size Id Type
/dev/sda1  *      2048    499711    497664  243M 83 Linux
/dev/sda2       501758 209713151 209211394 99.8G  5 Extended
/dev/sda5       501760 209713151 209211392 99.8G 8e Linux LVM

and

[[email protected] tmp]# mount
overlay on / type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/YUN7QB7JCVVRH5ZS4XA63HITO4:/var/lib/docker/overlay2/l/STJSTW7XY6656R6MK4HI63MGYZ:/var/lib/docker/overlay2/l/BWQTYCEG6X3ZTCXCU4PZKUIJID:/var/lib/docker/overlay2/l/4XJS5A4F33BJJZGZIKH7UM2TQ5:/var/lib/docker/overlay2/l/MMSEXD7BETBLVKHM5GTOCSPDNY:/var/lib/docker/overlay2/l/DRYVSQXANFMFTIXI5PRAOCNZJH:/var/lib/docker/overlay2/l/U7236TVVLEMZCHO5WRBINRNRLZ:/var/lib/docker/overlay2/l/R4CYY53TWBS3DEDH6ZBD7I3BCK:/var/lib/docker/overlay2/l/2T4H7URM6UDQMGZKJUVCHKXBU5:/var/lib/docker/overlay2/l/ZRYOFDRPJNOOZKJWLOH6K5NRC4:/var/lib/docker/overlay2/l/47TVKIYYQ2PTWWNOPBRYW7XCCC:/var/lib/docker/overlay2/l/FZZGKL6CKKYGKL42YVI4FKCGZA:/var/lib/docker/overlay2/l/4LEF3XUHSEIFJLWEVSYELSOOKY:/var/lib/docker/overlay2/l/3KFWFB3YGHXQNNOIOKQGTJZHTO:/var/lib/docker/overlay2/l/5AV2OKXJB4BW5G636VG6ZQM2JK:/var/lib/docker/overlay2/l/TLTL4DOVW6VHZKRV53K2SWVADC:/var/lib/docker/overlay2/l/7B3AVP2T3DYTTXBL7PLTKLSWTR:/var/lib/docker/overlay2/l/HQDFKLGPYSIOQ7HSLDKTSTHQ6K:/var/lib/docker/overlay2/l/4HMAAUJXH5XEW4F2ZGRITGEIHY:/var/lib/docker/overlay2/l/NX7URCVKWMFCXKR2LSFL5ANM3Z:/var/lib/docker/overlay2/l/QZPOVLPA3R3VONBEWVWW3XXHBB:/var/lib/docker/overlay2/l/2QLFM7X3CROHKO4NSOPYSNFUVH,upperdir=/var/lib/docker/overlay2/ed89d234552d386496fd2f60f597c276c613796a1e1a0bada8853f5d3dd93cf7/diff,workdir=/var/lib/docker/overlay2/ed89d234552d386496fd2f60f597c276c613796a1e1a0bada8853f5d3dd93cf7/work)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,size=65536k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
/dev/mapper/debian10--vg-root on /run type ext4 (rw,relatime,errors=remount-ro)
/dev/mapper/debian10--vg-root on /setup/out type ext4 (rw,relatime,errors=remount-ro)
/dev/mapper/debian10--vg-var on /etc/resolv.conf type ext4 (rw,relatime)
/dev/mapper/debian10--vg-var on /etc/hostname type ext4 (rw,relatime)
/dev/mapper/debian10--vg-var on /etc/hosts type ext4 (rw,relatime)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
devpts on /dev/console type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=26,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=106699)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)

hmm.. the next command gives a result i didn’t expect, because i’m sure it should be Centos8

[[email protected] tmp]# uname -a
Linux 17c80b9eeac7 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 x86_64 x86_64 GNU/Linux

That same command in my Debian VM(the docker host) gives

[email protected]:~/Documents/in-git/dockerfiles/test$ uname -a
Linux debian10 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

Source: Docker Questions

LEAVE A COMMENT