使用docker-tc对host容器进行限流

docker-tc是一个github开源项目,项目地址是https://github.com/lukaszlach/docker-tc

运行docker-tc

sh 复制代码
docker run -d \
--name docker-tc \
--network host \
--cap-add NET_ADMIN \
--restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/docker-tc:/var/docker-tc \
lukaszlach/docker-tc:latest

在容器中配置对其进行限速,限速为1mbit/s

yaml 复制代码
version: "3"

services:
  wxedge:
    image: onething1/wxedge:latest
    container_name: wxedge
    restart: always
    volumes:
      - /mnt/g/wxedge/storage:/storage:rw
    tmpfs:
      - /run
      - /tmp
    environment:
      - PLACE=CTKS
    logging:
      options:
        max-size: "10m"
    privileged: true
    network_mode: "host"
    labels:
      - "com.docker-tc.enabled=1"
      - "com.docker-tc.limit=1mbit"

是否生效有待观察

不行,这个东西很吃内存

不建议使用

相关推荐
wanhengidc12 小时前
云手机的适配性怎么样?
运维·服务器·安全·智能手机·云计算
jimy112 小时前
安卓里运行Linux
linux·运维·服务器
哟哟耶耶13 小时前
js-fetch流式实现中断重连
运维·服务器
爱凤的小光13 小时前
Linux清理磁盘技巧---个人笔记
linux·运维
字节数据平台15 小时前
刚刚,火山引擎多模态数据湖解决方案发布大数据运维Agent
大数据·运维·火山引擎
原神启动116 小时前
Docker 场景化作业:生产环境容器操作实训
运维·docker·容器
云老大TG:@yunlaoda36016 小时前
如何通过华为云国际站代理商CSBS进行备份策略设置?
运维·数据库·华为云
zly350017 小时前
linux查看正在运行的nginx的当前工作目录(webroot)
linux·运维·nginx
QT 小鲜肉17 小时前
【Linux命令大全】001.文件管理之file命令(实操篇)
linux·运维·前端·网络·chrome·笔记
呼啦啦呼啦啦啦啦啦啦17 小时前
docker制作镜像的两种方式(保姆级教学)
运维·docker·容器