fdisk doesn't find loop device in docker

Having a somewhat odd problem. I am testing out an installation on Docker that needs a free block device, here are the steps I took:

  • Mounted an image file as /dev/loop4 on the host
  • Wrote a label to it and created a partition: /dev/loop4p1 (this is for testing only, what I need is the raw device)
  • Launched a Docker container (ubuntu:14.04) in privileged mode

Now, using the device/partition works fine: I can mount it and read/write data; fdisk -l /dev/loop4 does the expected thing; it shows up in lsblk; and /proc/partitions looks as expected:

  • docker native networking vs weave net/flux/show
  • How copy files from current docker container to another container
  • Howto run a Prestashop docker container with persistent data?
  • Why does docker container prompt “Permission denied”?
  • Docker container cannot connect to linked containers services
  • Maven can create folders and lock file, but hangs while downloading
  • root@e1047c0fa3a3:/proc# cat /proc/partitions 
    major minor  #blocks  name
    
     259        0  500107608 nvme0n1
     259        1     266240 nvme0n1p1
     259        2  494927872 nvme0n1p2
     259        3    4912455 nvme0n1p3
       7        0  104857600 loop0
       7        1    2097152 loop1
       7        4   25165824 loop4
     259        4   25164783 loop4p1
     254        0  104857600 dm-0
     254        1   10485760 dm-1
    

    BUT if I run just fdisk -l, ‘loop4’ doesn’t show up (only the system drive comes up), and apparently that’s how the install tool I’m using is looking for available drives, so I can’t pick ‘loop4’.

    fdisk -l on the host shows everything from /proc/partitions.

    Any ideas on what else fdisk looks for when listing devices?

    Update

    Apparently this is a problem specifically on 14, and 16 works as expected. Still would be nice to have a workaround on 14.

  • MySQL databases are gone when the docker container is shutdown
  • Docker Data Volumes and Mounting to Host
  • chrome fake audioinput with real audio output?
  • Docker Compose with PHP, MySQL, nginx connection issue
  • I can't run docker daemon on ubuntu 14.04 LTS (on VPS)
  • Docker for Windows Beta + Docker Tools for Visual Studio — DockerTask.ps1 Error
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.