
容器就像是测试环境中的"虚拟机器人",我们需要学会如何启动、停止、进入和管理它们。掌握这些技能,就像学会了如何指挥一支高效的测试团队!
守护态运行:让容器在后台默默工作
在实际测试工作中,我们通常希望容器在后台运行,而不是占用我们的终端。这时候 -d 参数就派上用场了,就像雇了个不用管的助手。
如果不使用 -d 参数运行容器。
$ docker run ubuntu:18.04 /bin/sh -c "while true; do echo hello world; sleep 1; done"
hello world
hello world
hello world
hello world







