【问题标题】:docker container error when I run command **sed** [duplicate]运行命令 **sed** 时出现 docker 容器错误 [重复]
【发布时间】:2021-12-09 18:42:20
【问题描述】:

当我运行命令 sed 时,会出现下面的 msg:

sed -i 's/127.0.0.11/8.8.8.8/g' resolv.conf
sed: cannot rename ./sedHaHgXE: Device or resource busy

【问题讨论】:

    标签: python docker shell sed docker-compose


    【解决方案1】:

    使用下面的命令将实现特定的字符串替换:

     echo "$(sed 's/127.0.0.11/8.8.8.8/g' /etc/resolv.conf)" > /etc/resolv.conf
    

    related article

    【讨论】:

    • 这很有可能在sed 开始之前用空文件替换原始resolve.conf 文件。
    猜你喜欢
    • 2019-12-04
    • 2017-10-02
    • 2017-01-07
    • 2020-09-04
    • 1970-01-01
    • 1970-01-01
    • 2019-11-13
    • 1970-01-01
    • 2021-01-08
    相关资源
    最近更新 更多