一元网络论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 323|回复: 0

What is the most elegant way to run host commands inside a Docker container?

[复制链接]

3万

主题

3万

帖子

9万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
94101
发表于 2024-7-9 14:04:19 | 显示全部楼层 |阅读模式
For example, the most elegant ping is like this:
docker run --rm --net=host busybox ping -c 3 119.29.29.29

But I need to execute this command in the busybox, which doesn't have it. It's a speed test command called taierspeed, and it's placed on the host machine. How can I execute this command in the docker elegantly? Similar to above, just use the ping command and delete it after using it.

The purpose of running the docker is because I want to measure multiple broadband connections. When running the docker, I can customize the ip at runtime, and this ip will be divided into different broadband connections. Test the speed of the broadband.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|一元网络论坛

GMT+8, 2024-11-22 22:09 , Processed in 0.114143 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表