How to fix “loopback devices is strongly discouraged for production use” on Docker

Posted In Containerization - By Tum. On Monday, August 3rd, 2015 With 0 Comments

docker
สำหรับคนที่ใช้ docker (1.6+) บน CentOS7 หรือ RHEL7 จะพบ warning เกิดขึ้นกังตัวอย่างด้านล่าง

# docker run centos /bin/echo “ezylinux.com”
Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.

warning นี้เกิดจาก docker ได้ตั้งค่าการใช้งาน storage เป็น devicemapper และสร้าง loopback device (ตัวอย่าง /dev/loop0) ขึ้นมา เนื่องจากไม่พบ AUFS driver ซึ่งเป็น default storage ของ docker (จะมีอยู่ใน Ubuntu)

* Mode การทำงานนี้ loopback device บน devicemapper ไม่เหมาะกับ Production
** ทาง RedHat ไม่ชอบ AUFS จึงไม่ได้นำมาใช้ใน distro ของตนและได้ไปพัฒนา OverlayFS และ devicemapper thin provisioning มาใช้แทน

สำหรับแนวทางแก้ไขสามารถทำได้ดังนี้
ปิด Warning โดยแก้ไขที่ไฟล์ /etc/sysconfig/docker-storage

DOCKER_STORAGE_OPTIONS = “–storage-opt dm.no_warn_on_loop_devices = true”

DOCKER_STORAGE_OPTIONS = “–storage-opt dm.thinpooldev = /dev/mapper/VolGroup-docker”

Tags:

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*