背景
測試磁盤滿時程序的運行情況文章來源:http://www.zghlxwxcb.cn/news/detail-705276.html
問題
如何使用 docker 來模擬磁盤滿的情況文章來源地址http://www.zghlxwxcb.cn/news/detail-705276.html
解決方法
- 創(chuàng)建指定大小的數(shù)據(jù)卷 volume
docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=50M my_volumn
- 創(chuàng)建 docker 時,使用該數(shù)據(jù)卷
docker run -it -d --name test_io -v my_volumn:/home/test/test_io_volumn my_image /bin/bash
- 在容器中,
/home/test/test_io_volumn
文件夾就只有50M大小了
到了這里,關(guān)于【Docker】配置指定大小的磁盤空間的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!